<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>报告详情1</title>
    <meta charset="utf-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <link rel="stylesheet" href="/build/less/OaStyle.less">
    <style type="text/css">
        [v-cloak] {
            display: none;
        }
        .expenseValue{
            float: left;
            width: 130px;
            border: 1px solid #ddd;
            height: 30px;
            background-color: white;
            padding-left: 10px !important;
        }
        .expenseTitle{
            float: left;
            width: 103px;
            box-shadow: 0 0 black;
            line-height: 30px;
            letter-spacing: 3px;
        }
        .oa-footer-btn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #228bee;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            margin: 0 auto;
            z-index: 11111;
        }

        .oa-footer-btns {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #228bee;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 14px;
            margin: 0 auto;
            z-index: 11111;
        }

        .addressTitle {
            float: left;
            width: 80px;
            box-shadow: 0 0 black;
            line-height: 30px;
        }

        input.addressValue {
            float: left;
            width: 275px !important;
            border: 1px solid #ddd !important;
            height: 30px !important;
        }

        .saveExpense {
            width: 280px;
            height: 200px;
            position: fixed;
            top: 50%;
            left: 65%;
            margin-left: -200px;
            margin-top: -100px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle {
            width: 500px;
            height: 300px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -250px;
            margin-top: -150px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle .top, .saveExpense .top {
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            /* padding-left: 7px; */
            border-bottom: 1px solid #cfcfcf;
            background: #f5f5f5;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
        }

        .saveModle .top .title, .saveExpense .top .title {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            background: #F5F5F6;
            text-align: center;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
        }

        .saveModle .top .btn, .saveExpense .top .btn {
            font-size: 20px;
            width: 34px;
            height: 22px;
            line-height: 12px;
            position: absolute;
            right: 0;
            top: 0px;
        }

        .saveModle .top .btn:hover, .saveExpense .top .btn:hover {
            color: red;
        }


        .saveExpense .saveBtn {
            margin: 0 auto;
            display: block;
        }

        .shen a {
            display: inline-block;
            width: 30%;
            outline: 0;
            padding: 0;
            text-align: center;
            white-space: nowrap;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        table {
            border-collapse: collapse;
            border-right: 1px solid #cbcbcd;
            /*border-bottom:1px solid #cbcbcd;*/
            margin-left: 0px;
            margin-top: 0px;
            margin-bottom: 0px !important;
            margin-right: 0px;
        }

        th, td {
            border-top: 1px solid #cbcbcd;
            border-left: 1px solid #cbcbcd;
            color: #333;
            font-weight: normal;
            line-height: 24px;
            padding-top: 4px !important;
            padding-bottom: 4px !important;
        }

        th {
            background-color: #F8F8F8;
        }

        .table-border-right-none {
            border-right-width: 0px;
        }

        table .td-title {
            background-color: #f8f8f8;
            line-height: 0.24rem;
            font-weight: normal;
        }

        table .td-title2 {
            line-height: 0.24rem;
            font-weight: bold;
        }

        table .td-module {
            background-color: #f8f8f8;
            line-height: 0.24rem;
            font-weight: normal;
        }

        /*娴sir写*/
        .table > tbody > tr > td.td-row2 {
            height: 1rem;
            line-height: 0.3rem;
            max-height: 1rem;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row2 span {
            max-height: 0.9rem;
            /*height:35px;*/
            line-height: 0.3rem;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        .table > tbody > tr > td.td-row3 {
            height: 0.48rem;
            line-height: 0.2rem;
            max-height: 0.48rem;
            overflow: hidden;
        }

        .table > tbody > tr > td.td-row3 span {
            max-height: 0.6rem;
            line-height: 0.3rem;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .td-value span.lineOne {
            max-height: 0.3rem;
            line-height: 0.3rem;
            overflow: hidden;
            text-overflow: ellipsis;
            /*display: -webkit-box;*/
            /*-webkit-box-orient: vertical;*/
            /*-webkit-line-clamp: 1;*/
        }

        .td-value select {
            height: 24px;
            background-color: white;
        }

        input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0;
            border-style: none;
            padding-right: 0 !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            padding-left: 0.06rem;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 0.24rem;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
            /*-webkit-appearance: none;*/
        }

        textarea {
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            padding-top: 0.2rem;
            padding-left: 0.06rem;
        }

        .width90 {
            width: 0.96rem;
        }

        .width60 {
            width: 0.6rem;
        }

        .span-a-btn {
            position: absolute;
            right: 7px;
        }

        .userbox {
            border: 0.01rem #BBBBBB solid;
            background-color: White;
            width: 99%;
            overflow: hidden;
        }

        div.userbox {
            min-height: 0.21rem;
            padding-left: 0.06rem;
            padding-top: 0.06rem;
            height: auto;
        }

        input.userbox {
            height: 0.21rem;
            padding-left: 0.06rem;
            line-height: 0.21rem;
        }

        .userbox input {
            border-width: 0;
            border-style: none;
            width: 32px;
        }

        .user {
            height: 0.2rem;
            line-height: 0.2rem;
            max-height: 0.2rem;
            float: left;
            text-align: left;
            min-width: 0.32rem;
            padding-left: 0.01rem;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .over.user {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .saveModle {
            width: 5rem;
            height: auto;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -2.5rem;
            margin-top: -1.5rem;
            background: #fff;
            border-radius: 0.1rem;
            z-index: 1978;
            display: none;
            border: 0.01rem solid #cfcfcf;
        }

        .saveModle .top {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            background: #F5F5F6;
            text-align: center;
            border-top-left-radius: 10px;
            border-top-right-radius: 10px;
        }

        .saveModle .top .title {
            height: 0.32rem;
            line-height: 0.32rem;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            float: left;
            background: #fff;
            margin-left: 120px;
            margin-top: 6px;
        }

        .saveModle .top .btn {
            font-size: 20px;
            width: 34px;
            height: 22px;
            line-height: 12px;
            position: absolute;
            right: 0;
            top: 0px;
        }

        .saveModle .top .btn:hover {
            color: red;
        }

        .saveModle .saveBtn {
            margin: 0 auto;
            display: block;
            margin-bottom: 10px;
        }

        .modleBj {
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            z-index: 1977;
            background: #DCE2F1;
            filter: alpha(opacity=60);
            opacity: .6;
            display: none;
        }

        #modal {
            height: 100%;
            width: 100%;
            position: absolute;
            z-index: 999;
            background-color: white;
        }

        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
        }

        .table > tbody > tr > td {
            padding: 0px !important;
            padding: 0 2px;
            height: 24px;
            vertical-align: middle;
        }

        .td-value span {
            display: inline-block;
            max-height: 0.56rem;
            overflow: hidden;
            padding-left: 0.06rem;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            background-color: #d3e8fd;
            padding: 0.08rem 0.06rem;
            border: 0.01rem solid #e8e8ea;
            display: none;
            overflow: hidden;
        }

        .div-td-content-more i {
            width: 0.15rem;
            height: 0.12rem;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 0.5rem;
            top: -.12rem;
        }

        .table-bordered tbody tr:last-child td {
            /*border-bottom-color: transparent !important;*/
        }

        .lastTable tbody tr:last-child td {
            border-bottom-color: #cbcbcd !important;
        }

        h5 {
            padding: 0;
            font-size: 12px;
            text-align: center;
            color: #333333;
        }

        td.bd_none {
            padding: 0 !important;
            border: 0 !important;
            border-width: 0 !important;
        }

        .jiaobiao {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 .12rem .12rem;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .tit {
            background-color: #d3e8fd;
            line-height: 0.24rem;
            height: 0.24rem;
            font-weight: bold;
        }

        .td-title1 {
            line-height: 0;
        }

        .btn-blue {
            border: none;
            background: #2a8ced;
            color: #fff;
            font-size: 0.22rem;
            height: 0.58rem;
            width: 14%;
        }

        .btn-blue.focus, .btn-blue:focus, .btn-blue:hover {
            color: #fff;
            text-decoration: none;
        }

        .table > tbody > tr > th {
            padding: 0px !important;
            padding: 0 2px;
            height: 24px;
            vertical-align: middle;
        }

        .pingjia {
            border: 1px solid rgb(188, 184, 184);
            width: 50%;
            height: 22px;
            line-height: 20px;
            color: rgb(188, 184, 184);
            float: left;
            margin-left: 0px;
            text-align: center;
            margin-top: 5px;
            cursor: pointer;
            font-size: 13px;
            -webkit-transform: scale(0.9);
        }

        table {
            table-layout: fixed;
            border: none;
            border-right: 1px solid #ddd;
        }

        .pingjia_active {
            border: 1px solid #2a8cec;
            width: 50%;
            height: 22px;
            line-height: 20px;
            background: #2a8cec;
            color: #ffffff;
            float: left;
            margin-left: 0px;
            text-align: center;
            margin-top: 5px;
            cursor: pointer;
            font-size: 13px;
            -webkit-transform: scale(0.9);
        }

        .but_tijiao {
            border: none;
            background: #2a8ced;
            color: #fff;
            width: 21%;
            height: 20px;
            line-height: 9px;
            font-size: 10px;
            border-radius: 0px;
        }

        .divMore {
            width: 12px;
            height: 12px;
            position: absolute;
            background-image: url(/dist/img/gengduo.png);
            background-repeat: no-repeat;
            background-size: cover;
            right: 8px;
            top: 40px;
            z-index: 99;
        }

        .divMore_active {
            width: 12px;
            height: 12px;
            position: absolute;
            background-image: url(/dist/img/shouqi.png);
            background-repeat: no-repeat;
            background-size: cover;
            right: 8px;
            top: 40px;
            z-index: 99;
        }

        .evaluation {
            cursor: pointer;
            width: 36px;
            margin: 0 auto;
            height: 19px;
            line-height: 18px;
            text-align: justify;
            display: inline-block;
            overflow: hidden;
            vertical-align: middle;
        }

        .icon_radio {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: solid 1px #aaaaaa;
            background-color: #ffffff;
            cursor: pointer;
            position: absolute;
            top: 0px;
            left: 23px;
        }

        .icon_active_radio {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            border: solid 1px #aaaaaa;
            /*background-color: #0076FF;*/
            background: url("/dist/img/duigouw.png") -2px center no-repeat;

            position: absolute;
            top: 0px;
            left: 23px;
        }

        .divOne {
            max-height: 35px;
            line-height: 35px;
            height: 35px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .oa-name {
            float: left;
            margin-left: 2px;
        }
    </style>
    <script src="/dist/js/pages/wreport/service.js?t=42e28def"></script>
    <script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>

</head>
<body style="background-color:#fff;">
<div class="div-td-content-more" style="width: 100%;"><i></i></div>
<div class="clearfix"></div>
<section v-cloak class="content" id="app" style="padding: 0 0.04rem;">
    <div class="model-picker-dropdown">
        <div class="model-select-wrap">
            <div class="model-select-tab">
                <a class="active" data-count="type">省</a><a class="" data-count="brand">市</a><a data-count="model"
                                                                                                class="">县</a>
            </div>
            <div class="model-select-content">
                <div class="model-select type shen" data-count="type" style="display: block;">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in provinceList">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select brand" data-count="province">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in cityList">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select model" data-count="model">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in countyList">{{item.name}}</a>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <!--<div class="saveAddress">-->
    <!--<div class="top">-->
    <!--<div class="title">客户所在地</div>-->
    <!--<div class="btn" v-on:click="closeAddress"> x</div>-->
    <!--</div>-->
    <!--<div class="header box-body" style="padding: 25px 20px;padding-bottom: 0;">-->

    <!--<div class="form-group" style="overflow: hidden">-->
    <!--<div class="addressTitle" style="letter-spacing: 3px;">客户所在县</div>-->
    <!--<input type="text" style="padding-left: 6px" class="addressValue xianValue selectModel" readonly-->
    <!--placeholder="请选择县">-->
    <!--</div>-->
    <!--<div class="form-group" style="overflow: hidden">-->
    <!--<div class="addressTitle">客户详细地址</div>-->
    <!--<input type="text" class="addressValue xianxiValue">-->
    <!--</div>-->
    <!--</div>-->
    <!--<input type="button" value="确定" class="saveBtn btn oaBtn" @click="saveAddressBtn">-->
    <!--</div>-->
    <div class="td-value1"
         style="width: 114px;height: auto; margin-left: 0px;display: none;position: absolute;z-index:999; border: 1px solid #cbcbcd; !important;margin-left: 0px;background-color: white"
         id="entourage">
        <input v-for="(item,i) in entourage" type="text"
               style="margin:0;text-align: left;width: 100%;cursor: pointer;line-height: 24px;color:#2a8cec;padding-left: 6px"
               v-model="item.name" @click="addEntourage(item.name,divInEntourage)">
    </div>
    <div class="divOne" style="width:300px;margin: 0 auto;text-align: center;">
        <span class="text-center" style="font-size: 14px">{{report.main.title}}</span>
    </div>
    <!--评价列表-->
    <table class="table text-center" style="margin-bottom:15px !important;"
           v-if="pingjiaFlag=='true'">
        <tr>
            <th style="border-bottom: none;position: relative" class="tit">评价列表</th>
            <div v-if="commentList.length>1"
                 :class="checkMore=='gengduo'?'divMore':'divMore_active'"
                 @click="checkMore1()"></div>
        </tr>
        <tr v-if="commentList.length>0">
            <td class="bd_none">
                <table class="table  text-center table-border-right-none"
                       v-if="checkMore=='gengduo'&&i<1"
                       v-for="(item,i) in commentList">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>评价人</th>
                        <td class="td-value" style="width:25%">
                            <span>{{item.createUserName}}</span>
                        </td>
                        <th style="width:25%">是否合格</th>
                        <td style="width:25%" class="td-value" v-if="item.grade=='未评价'">
                            <span>{{item.grade}}</span>
                        </td>
                        <td style="width:25%" v-else class="td-value">
                            <span>{{item.grade=='合格'?'是':'否'}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%;border-bottom: 1px solid #cdcdce;" class="td-row2">内容
                        </th>
                        <td colspan="4" class="td-value td-row2"
                            style="border-bottom: 1px solid #cbcbcd;"><span
                                class="lineOne">{{item.otherDescription}}</span>
                        </td>
                    </tr>
                </table>

                <table class="table  text-center table-border-right-none" v-if="checkMore=='shouqi'"
                       v-for="(item,i) in commentList">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>评价人</th>
                        <td class="td-value" style="width:25%">
                            <span>{{item.createUserName}}</span>
                        </td>
                        <th style="width:25%">是否合格</th>
                        <td style="width:25%" class="td-value" v-if="item.grade=='未评价'">
                            <span>{{item.grade}}</span>
                        </td>
                        <td style="width:25%" v-else class="td-value">
                            <span>{{item.grade=='合格'?'是':'否'}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%;width:25%;border-bottom: 1px solid #cdcdce;"
                            class="td-row2">内容
                        </th>
                        <td colspan="4" class="td-value td-row2"
                            style="border-bottom: 1px solid #cbcbcd;"><span>{{item.otherDescription}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-else>
            <td style="border-bottom: 1px solid #cdcdce;">
                {{commentTishi}}
            </td>
        </tr>
    </table>
    <!----------------次日上午安排、次日下午安排、心得体会、需要公司<br>支持的事项-->
    <table class="table text-center">
        <!--<tr v-if="isHasModule('tomorrowAMPlan')">-->
        <!--<th style="width:25%" class="td-title1">次日上午安排</th>-->
        <!--<td v-if="isHasModule('tomorrowAMPlan')" class="td-value">-->
        <!--<input v-if="pageType=='edit'" type="text" style="padding-right: 1000px"-->
        <!--v-model="report.tomorrowAMPlan.content"/>-->
        <!--<span v-else class="lineOne">{{report.tomorrowAMPlan.content}}</span>-->
        <!--</td>-->
        <!--&lt;!&ndash;<td class="td-value">&ndash;&gt;-->
        <!--&lt;!&ndash;<span class="lineOne">{{report.tomorrowAMPlan.content}}</span>&ndash;&gt;-->
        <!--&lt;!&ndash;</td>&ndash;&gt;-->
        <!--</tr>-->
        <!--<tr v-if="isHasModule('tomorrowPMPlan')">-->
        <!--<th class="td-title1" style="width:25%">次日下午安排</th>-->
        <!--<td class="td-value">-->
        <!--<input v-if="pageType=='edit'" type="text" v-model="report.tomorrowPMPlan.content"/>-->
        <!--<span v-else>{{report.tomorrowPMPlan.content}}</span>-->
        <!--</td>-->
        <!--&lt;!&ndash;<td class="td-value">&ndash;&gt;-->
        <!--&lt;!&ndash;<span>{{report.tomorrowPMPlan.content}}</span>&ndash;&gt;-->
        <!--&lt;!&ndash;</td>&ndash;&gt;-->
        <!--</tr>-->
        <tr v-if="isHasModule('experience')" style="height: 24.8px !important;">
            <th class="td-title1" style="width:25%">心得体会</th>
            <td v-if="isHasModule('experience')" class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="report.experience.content"
                       style="text-align: left !important;padding-left: 0.06rem;"/>
                <span v-else class="lineOne">{{report.experience.content}}</span>
            </td>
            <!--<td class="td-value">-->
            <!--<span class="lineOne">{{report.experience.content}}</span>-->
            <!--</td>-->
        </tr>
        <tr v-if="isHasModule('forSupportMatters')" v-for="(matter,i) in report.forSupportMatters">
            <th rowspan="2" style="line-height: 0.24rem;width: 25%" v-if="i==0" class="td-title1">
                需要公司<br>支持的事项
            </th>
            <td class="td-value" style="height: 25px">
                <input v-if="pageType=='edit'" type="text" v-model="matter.trackContent"
                       style="text-align: left !important;padding-left: 0.06rem;">
                <span v-else class="lineOne">{{matter.trackContent}}</span>
            </td>
            <!--<td class="td-value"><span class="lineOne">{{matter.trackContent}}</span></td>-->
        </tr>
    </table>
    <!--人员情况、第二天计划、当天未处理的前三个疑难故障-->
    <table class="table text-center">
        <tr v-if="isHasModule('personSituation')">
            <th class="td-title1" style="width:25%">人员情况</th>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text"
                       v-model="report.personSituation.content" style="text-align: left !important;padding-left: 0.06rem;"/>
                <span v-else>{{report.personSituation.content}}</span>
            </td>
            <!--<td class="td-value">-->
            <!--<span class="lineOne">{{report.personSituation.content}}</span>-->
            <!--</td>-->
        </tr>
        <tr v-if="isHasModule('tomorrowPlan')">
            <th class="td-title1" style="width:25%">第二天计划</th>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="report.tomorrowPlan.content"
                       style="text-align: left !important;padding-left: 0.06rem;"/>
                <span v-else class="lineOne">{{report.tomorrowPlan.content}}</span>
            </td>
            <!--<td class="td-value">-->
            <!--<span class="lineOne">{{report.tomorrowPlan.content}}</span>-->
            <!--</td>-->
        </tr>
        <tr v-if="isHasModule('troubleShooting')" v-for="(item,i) in report.troubleShooting">
            <th style="width:25%" rowspan="3" class="td-title" v-if="i==0">当天未处理的前三个疑难故障</th>
            <td class="td-value">
                <input v-if="pageType=='edit'" type="text" v-model="item.trackContent" style="padding-left: 0.06rem;"/>
                <span v-else>{{item.trackContent}}</span>
            </td>
            <!--<td class="td-value">-->
            <!--<span class="lineOne">{{item.trackContent}}</span>-->
            <!--</td>-->
        </tr>
    </table>
    <!--第二天面访计划(区域)-->
    <table class="table text-center" v-if="isHasModule('tomorrowVisitPlanRegion')">
        <tr>
            <th style="border-bottom: none;" class="tit">第二天面访计划(区域)</th>
        </tr>
        <tr>
            <td class="bd_none" v-if="isHasModule('tomorrowVisitPlanRegion')">
                <table class="table text-center table-border-right-none">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>拜访目的</th>
                        <th style="width:25%">客户名称</th>
                        <th style="width:25%">陪同人员</th>
                        <th>地点</th>
                    </tr>
                    <tr v-for="(item,i) in report.tomorrowVisitPlan">
                        <td class="td-value" style="text-align:center !important;">
                            <!--<select v-if="pageType=='edit'" v-model="item.visitGoal" :id="'visitGoal'+i"-->
                            <!--@change="clearData(i)">-->
                            <!--<option v-for="option in visitBigGoalList" v-bind:value="option.value">-->
                            <!--{{option.text}}-->
                            <!--</option>-->
                            <!--</select>-->
                            <span>{{item.visitGoal}}</span>
                        </td>
                        <td style="text-align:center !important;" class="td-value">
                            <!--<input type="text" v-if="pageType=='edit'" v-model="item.customerName"-->
                            <!--style="text-align: center !important;" @click="onfocus1(i)">-->
                            <span>{{item.customerName}}</span>
                        </td>
                        <td class="td-value" style="text-align:center !important;">
                            <!--<input type="text" v-if="pageType=='edit'" :id="'entourage'+i" class="visitGoalShow"-->
                            <!--v-model="item.entourage"-->
                            <!--@click="onfocus1(i),getEntourage($event,i,'tomorrowVisitPlanBigRegion')"-->
                            <!--readonly style="text-align: center !important;">-->
                            <span>{{item.entourage}}</span>
                        </td>
                        <td class="td-value">
                            <!--<template v-if="pageType=='edit'">-->
                            <!--<input @click="openAddress(i)" :value="item.customerAddress" type="text" readonly-->
                            <!--style="text-align: left"/>-->
                            <!--</template>-->
                            <span class="lineOne">{{item.customerAddress}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--第二天面访计划 区域经理 上午计划和下午计划-->
    <table class="table text-center" v-if="isHasModule('tomorrowAMPlan')&&isHasModule('tomorrowPMPlan')">
        <tr>
            <th style="border-bottom: none;" class="tit">第二天面访计划(区域)</th>
        </tr>
        <tr>
            <table class="table text-center table-border-right-none" v-if="isHasModule('tomorrowAMPlan')">
                <tbody>
                <tr>
                    <td class="td-title" style="width: 25%">上午计划描述</td>
                    <td class="td-value">
                                <textarea v-if="pageType=='edit'"
                                          v-model="report.tomorrowAMPlan.content"></textarea>
                        <span v-else>{{report.tomorrowAMPlan.content}}</span>
                    </td>
                </tr>
                </tbody>
            </table>
        </tr>
        <tr>
            <table class="table text-center table-border-right-none" v-if="isHasModule('tomorrowPMPlan')">
                <tbody>
                <tr>
                    <td class="td-title" style="width: 25%">下午计划描述</td>
                    <td class="td-value">
                                <textarea v-if="pageType=='edit'"
                                          v-model="report.tomorrowPMPlan.content"></textarea>
                        <span v-else>{{report.tomorrowPMPlan.content}}</span>
                    </td>
                </tr>
                </tbody>
            </table>
        </tr>
    </table>
    <!--第二天拜访计划(大区)-->
    <table class="table text-center" v-if="isHasModule('tomorrowVisitPlanBigRegion')">
        <tr>
            <th style="border-bottom: none;" class="tit">第二天拜访计划(大区)</th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table text-center table-border-right-none">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>拜访目的</th>
                        <th style="width:25%">客户名称</th>
                        <th style="width:25%">陪同人员</th>
                        <th>地点</th>
                    </tr>
                    <tr v-for="(item,i) in report.tomorrowVisitPlan">
                        <td class="td-value" style="text-align:center !important;">
                            <select v-if="pageType=='edit'" v-model="item.visitGoal" :id="'visitGoal'+i"
                                    @change="clearData(i)">
                                <option v-for="option in visitBigGoalList" v-bind:value="option.value">
                                    {{option.text}}
                                </option>
                            </select>
                            <span v-else>{{item.visitGoal}}</span>
                        </td>
                        <td style="text-align:center !important;" class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.customerName"
                                   style="text-align: center !important;">
                            <span v-else>{{item.customerName}}</span>
                        </td>
                        <td class="td-value" style="text-align:center !important;">
                            <span>{{item.entourage}}</span>
                        </td>
                        <td class="td-value">
                            <span class="lineOne">{{item.customerAddress}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当日工作情况描述-->
    <table class="table text-center" v-if="isHasModule('workOnTodayDescsZjlNew')">
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th colspan="2" style="border-bottom: none;" class="tit">
                <span v-if="isHasModule('workOnTodayDescsZjlNew')">当日工作情况描述</span>
            </th>
        </tr>
    </table>
    <!--销售、服务、财务、信控、债券、行政人事-->
    <table class="table text-center" v-if="isHasModule('workOnTodayDescsZjlNew')">
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">销售</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.saleList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.saleList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">服务</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.serverList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.serverList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">财务</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.financeList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.financeList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">信控</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.diconList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.diconList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">债权</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.bondList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.bondList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr v-if="isHasModule('workOnTodayDescsZjlNew')">
            <th class="td-title1" style="width: 25%">行政人事</th>
            <td style="padding: 0px;">
                <table class="table text-center" style="border: none">
                    <tr v-for="(work,i) in report.workOnTodayDescsZjlNew.personList">
                        <td class="td-value td-row3" style="border-top: 0px;border-left: 0px"
                            :style="i==report.workOnTodayDescsZjlNew.personList.length-1?'':'border-bottom: 1px solid #ddd !important;'">
                            <template v-if="pageType=='edit'">
                                <textarea v-model="work.content"></textarea>
                            </template>
                            <span v-else  v-html="work.content"></span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当日面访情况-->
    <table class="table text-center" v-if="isHasModule('todayCustomerVisit')">
        <tr>
            <th style="border-bottom: none;" class="tit">当日面访情况</th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayCustomerVisit">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.tel"/>
                            <span v-else>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">客户来源</th>
                        <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
                        <td style="width:25%" class="td-value">
                            <select v-if="pageType=='edit' &&item.visitMode!=1" v-model="item.source">
                                <option v-for="option in cusSource" v-bind:value="option.value">
                                    {{option.text}}
                                </option>
                            </select>
                            <span v-else>{{item.source}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">姓名</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'&&item.visitMode!=1 " type="text" v-model="item.name"/>
                            <span v-else>{{item.name}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">拜访方式</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.visitMode}}</span>
                        </td>

                    </tr>
                    <tr>
                        <th style="width:25%">陪同人员</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.entourage}}</span>
                        </td>
                        <th style="width:25%">意向型号</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.intentionModel}}</span>
                        </td>


                    </tr>
                    <tr>
                        <th style="width:25%">购买方式</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.buyType}}</span>
                        </td>
                        <th style="width:25%">购买时间</th>
                        <td style="width:25%" class="td-value">
                            <span>{{changeBuyDate(item.buyDate)}}</span>
                        </td>
                    </tr>
                    <tr v-if="(report.main.title.indexOf('大客户')!=-1)">
                        <th>客户公司</th>
                        <td class="td-value" colspan="3">
                            <span>{{item.companyName}}</span>
                        </td>
                    </tr>
                    <tr>
                        <!--<th>基本情况</th>-->

                        <!--<td class="td-row2 width60 td-value1">-->
                        <!--<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>-->
                        <!--<span v-else>{{item.birthDay}}</span>-->
                        <!--</td>-->
                        <td class="td-value td-row2" style="border-left: none" colspan="4">
                            <span>{{item.otherCondition}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--今日面访/电访情况描述-->
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomer')">
        <tr>
            <th style="border-bottom: none;position: relative; " class="tit">
                <span :style="leaderFlag=='1'?'margin-left: 50px;':''">今日面访/电访情况描述</span>
                <input
                        type="button" value="轨迹"
                        style="float: right;line-height: 11px;width: 40px;height: 17px;padding-left: 6px;padding-right: 6px;padding-bottom: 0px;padding-top: 0px;"
                        class="oaBtn btn-primary"
                        @click="track"
                        v-if="leaderFlag=='1'">
                <span class="span-a-btn " v-if="pageType=='edit'" style="top: 4px;">
                    <a href="javascript:void(0);" class="a-btn"
                       @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加一行</a>
                    <a href="javascript:void(0);" class="a-btn"
                       @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr class="td-title2">
            <td style="    padding: 0;padding-top: 0px !important;border: none;">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayVisitCustomer">
                    <tr>
                        <th style="width:25%;border-left: none;" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'&&item.visitMode!=1" type="text" v-model="item.tel" style="text-align: center !important;" @blur="findCusByTel(item)"/>
                            <span v-else>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">客户来源</th>
                        <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
                        <td style="width:25%" class="td-value">
                            <select v-if="pageType=='edit' &&item.visitMode!=1" v-model="item.source"
                                    style="height: 24px !important;">
                                <option v-for="option in cusSource" v-bind:value="option.value">
                                    {{option.text}}
                                </option>
                            </select>
                            <span v-else>{{item.source}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%;border-left: none;">客户类型</th>
                        <td style="width:25%;" class="td-value">
                            <select v-if="pageType=='edit'&&item.visitMode!=1" v-model="item.customerType">
                                <option v-for="option in customerType">
                                    {{option.customerType}}
                                </option>
                            </select>
                            <span v-else>{{item.customerType}}</span>
                        </td>
                        <th style="width:25%;">是否意向客户</th>
                        <td style="width:25%;" class="td-value">
                            <span v-if="pageType=='edit'" style="display: flex;align-items: center;">
                                  <label style="margin-left: 0px;margin-bottom: 0px !important;" style="width: 25%;"
                                         @change="goIntent(i,item)">
                                       <input style="margin-left: 3px;float: left" class="tdInput"
                                              type="radio"
                                              value="1" v-model="item.intentionFlag">
                                      <span style="float: left;height: 20px;line-height: 20px;font-weight: 500;">是</span>
                                  </label>
                                  <label style="margin-left: 0px;margin-bottom: 0px !important;">
                                      <input class="tdInput" style="margin-left: 15px;float: left"
                                             type="radio"
                                             value="0" v-model="item.intentionFlag"><span
                                          style="float: left;height: 20px;line-height: 20px;font-weight: 500;">否</span>
                                  </label>
                            </span>
                            <template v-else>
                                <span v-if="item.tel==''"></span>
                                <span v-else class="td-value"
                                      style="text-align: center !important;">{{item.intentionFlag=='1'?'是':'否'}}</span>
                            </template>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%;border-left: none;">姓名</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'&&item.visitMode!=1 " type="text" v-model="item.name" style="text-align: center !important;"/>
                            <span v-else>{{item.name}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">拜访方式</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.visitMode}}</span>
                        </td>

                    </tr>
                    <template v-if="pageType!='edit'">
                        <tr>
                            <th style="width:25%;border-left: none;">陪同人员</th>
                            <td style="width:25%" class="td-value">
                                <span>{{item.entourage}}</span>
                            </td>
                            <th style="width:25%">意向型号</th>
                            <td style="width:25%" class="td-value">
                                <span>{{item.intentionModel}}</span>
                            </td>


                        </tr>
                        <tr>
                            <th style="width:25%;border-left: none;">购买方式</th>
                            <td style="width:25%" class="td-value">
                                <span>{{item.buyType}}</span>
                            </td>
                            <th style="width:25%">购买时间</th>
                            <td style="width:25%" class="td-value">
                                <span>{{changeBuyDate(item.buyDate)}}</span>
                            </td>
                        </tr>
                    </template>
                    <tr v-if="(report.main.title.indexOf('大客户')!=-1)">
                        <th style="border-left: none">客户公司</th>
                        <td class="td-value" colspan="3">
                            <input v-if="pageType=='edit'" type="text" v-model="item.companyName"/>
                            <span v-else>{{item.companyName}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-value td-row2" style="border-left: none" colspan="4">
                            <textarea v-if="pageType=='edit'"
                                      v-model="item.otherCondition"
                                      placeholder="此处填写:资金情况、来源(首付款金额)、已有设备(设备类型)、股东构成、行业经验、信誉、工程情况、竞争对手情况"></textarea>
                            <span v-else>{{item.otherCondition}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当日拜访客户 服务人员 todayVisitCustomerService-->
    <table class="table  table-bordered text-center"
           v-if="isHasModule('todayVisitCustomerService')">
        <tr>
            <th style="border-bottom: none;position: relative" class="tit"><span>当日拜访客户</span> <input type="button"
                                                                                                      value="轨迹"
                                                                                                      class="oa-pager-button btn oaBtn btn-sm pull-right"
                                                                                                      :style="leaderFlag=='1'?'margin-left: 20px;':''"
                                                                                                      style="padding: 0px ;border: 0px;width: 40px"
                                                                                                      @click="track"
                                                                                                      v-if="leaderFlag=='1'">
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr class="td-title2">
            <td style="padding: 0px !important;">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayVisitCustomer">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.tel"/>
                            <span v-else>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">姓名</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                            <span v-else>{{item.name}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">客户类型</th>
                        <td style="width:25%" class="td-value" colspan="3">
                            <template v-if="pageType='edit'">
                                <label v-for="(item2,index) in serverCustomerType"
                                       style="margin-right: 10px">
                                    <input type="radio" value="item2.value" name="serverCustomerType" v-bind:value="item.value"/><span>{{item2.value}}</span>
                                </label>
                            </template>
                            <template v-else>
                                <label v-for="(item2,index) in serverCustomerType"
                                       style="margin-right: 10px">
                                    <input disabled="disabled" type="checkbox" value="item2.value"
                                           :checked="(item.checkedServerCustomerLists).indexOf(item2.value)>=0"/>{{item2.value}}
                                </label>
                            </template>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">陪同人员</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.entourage}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">服务类型</th>
                        <td style="width:25%" class="td-value">
                            <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                                <option v-for="option in serverVisitType">
                                    {{option.value}}
                                </option>
                            </select>
                            <span v-else>{{item.otherVisitType}}</span>
                        </td>

                    </tr>
                    <tr>
                        <th style="width:25%">机型</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.intentionModel"/>
                            <span v-else>{{item.intentionModel}}</span>
                        </td>
                        <th style="width:25%">序列号</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.serialNo"/>
                            <span v-else>{{item.serialNo}}</span>
                        </td>

                    </tr>
                    <tr>
                        <th>配件收费金额</th>
                        <td class="td-value">
                            <template v-if="pageType=='edit'">
                                <input type="text" v-model="item.accessoriesChargesCondition"/>
                            </template>
                            <span v-else>{{item.accessoriesChargesCondition}}元</span>
                        </td>
                        <th>工时收费金额</th>
                        <td class="td-value">
                            <template v-if="pageType=='edit'">
                                <input type="text" v-model="item.hoursChargesCondition"/>
                                <!--<span style="position: absolute;top: 24px;right: 6px">元</span>-->
                            </template>
                            <span v-else>{{item.hoursChargesCondition}}元</span>
                        </td>
                    </tr>
                    <tr>
                        <th>设备小时数</th>
                        <td class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.deviceHour"/>
                            <span class="lineOne" v-else>{{item.deviceHour}}</span>
                        </td>
                        <th>发动机编号</th>
                        <td class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.machineNo"/>
                            <span class="lineOne" v-else>{{item.machineNo}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>收费情况</th>
                        <td class="td-value" colspan="3">
                            <!--<select v-if="pageType=='edit'" v-model="item.feeType">-->
                            <!--<option v-for="option in feeType">-->
                            <!--{{option.value}}-->
                            <!--</option>-->
                            <!--</select>-->
                            <template v-if="pageType='edit'">
                                <label v-for="(item2,index) in feeType"
                                       style="margin-right: 10px">
                                    <input type="radio" value="item2.value" name="feeType" v-bind:value="item.value"/><span>{{item2.value}}</span>
                                </label>
                            </template>
                            <span class="lineOne" v-else>{{item.feeType}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>服务内容</th>
                        <td class="td-value" colspan="3">
                            <textarea v-if="pageType=='edit'"
                                      v-model="item.serverCondition"></textarea>
                            <span v-else>{{item.serverCondition}}</span>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>
    <!--当日拜访客户 债权 todayVisitCustomerDebt-->
    <table class="table  table-bordered text-center" v-if="isHasModule('todayVisitCustomerDebt')">
        <tr>
            <th style="border-bottom: none;position: relative" class="tit"><span>当日拜访客户</span> <input type="button"
                                                                                                      value="轨迹"
                                                                                                      class="oa-pager-button btn oaBtn btn-sm pull-right"
                                                                                                      style="padding: 0px ;border: 0px;width: 40px"
                                                                                                      @click="track"
                                                                                                      v-if="leaderFlag=='1'">
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr class="td-title2">
            <td style="padding: 0px !important;">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayVisitCustomer">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                            <span v-else>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">姓名</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                            <span v-else>{{item.name}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">陪同人员</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.entourage}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">拜访方式</th>
                        <td style="width:25%" class="td-value">
                            <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                                <option v-for="option in debtVisitType">
                                    {{option.value}}
                                </option>
                            </select>
                            <span v-else>{{item.otherVisitType}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>情况描述</th>
                        <td class="td-value" colspan="3">
                            <textarea v-if="pageType=='edit'"
                                      v-model="item.debtCondition"></textarea>
                            <span v-else>{{item.debtCondition}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当日拜访客户 信控 todayVisitCustomerLetters-->
    <table class="table  table-bordered text-center"
           v-if="isHasModule('todayVisitCustomerLetters')">
        <tr>
            <th style="border-bottom: none;position: relative" class="tit"><span>当日拜访客户</span> <input type="button"
                                                                                                      value="轨迹"
                                                                                                      class="oa-pager-button btn oaBtn btn-sm pull-right"
                                                                                                      style="padding: 0px ;border: 0px;width: 40px"
                                                                                                      @click="track"
                                                                                                      v-if="leaderFlag=='1'">
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayVisitCustomer','CustomerSalerVisit')">添加拜访客户</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayVisitCustomer')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr class="td-title2">
            <td style="padding: 0px !important;">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayVisitCustomer">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" @blur="findCusByTel(item)" type="text" v-model="item.tel"/>
                            <span v-else>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">姓名</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="text" v-model="item.name"/>
                            <span v-else>{{item.name}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">陪同人员</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.entourage}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">拜访方式</th>
                        <td style="width:25%" class="td-value">
                            <select v-if="pageType=='edit'" v-model="item.otherVisitType">
                                <option v-for="option in lettersVisitType">
                                    {{option.value}}
                                </option>
                            </select>
                            <span v-else>{{item.otherVisitType}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>情况描述</th>

                        <!--<td class="td-row2 width60 td-value1">-->
                        <!--<input v-if="pageType=='edit'" type="text" v-model="item.birthDay"/>-->
                        <!--<span v-else>{{item.birthDay}}</span>-->
                        <!--</td>-->
                        <td class="td-value" colspan="3">
                            <textarea v-if="pageType=='edit'"
                                      v-model="item.lettersCondition"></textarea>
                            <span v-else>{{item.lettersCondition}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--今日其它事务描述、当日工作情况描述-->
    <table class="table text-center" v-if="isHasModule('workOnTodayDescs')">
        <tr>
            <th class="tit"  style="position: relative;">
                <span v-if="isHasModule('todayVisitCustomer')||isHasModule('workOnTodayDescsZjlNew')
                ||isHasModule('todayVisitCustomerDebt')">今日其它事务描述</span>
                <span v-else>当日工作情况描述</span>
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('workOnTodayDescs','WorkOnTodayDesc')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('workOnTodayDescs')">删除一行</a>

                </span>
            </th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table text-center table-border-right-none"
                       v-for="(work,i) in report.workOnTodayDescs">
                    <tr v-if="isHasModule('workOnTodayDescs')">
                        <td width="95%" class="td-value td-row2">
                            <template v-if="pageType=='edit'">
                                <textarea v-if="isHasModule('todayVisitCustomer')||isHasModule('workOnTodayDescsZjl')"
                                          v-model="work.content"></textarea>
                                <textarea v-else v-model="work.content"></textarea>
                            </template>
                            <span v-else>{{work.content}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--暂未使用的当日电访情况-->
    <table class="table text-center" v-if="isHasModule('todayCustomerTelVisit')">
        <tr>
            <th style="border-bottom: none;" class="tit">当日电访情况</th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.todayCustomerTelVisit">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户电话</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.tel}}</span>
                        </td>
                        <th style="width:25%">客户来源</th>
                        <!--<td class="td-row2"><input type="text" v-model="item.source"/></td>-->
                        <td style="width:25%" class="td-value">
                            <span>{{item.source}}</span></td>
                    </tr>
                    <tr>
                        <th style="width:25%">姓名</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.name}}</span>
                        </td>
                        <!--<td style="width: 60px;">客户生日</td>-->
                        <th style="width:25%">拜访方式</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.visitMode}}</span>
                        </td>

                    </tr>
                    <tr>
                        <th style="width:25%">陪同人员</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.entourage}}</span>
                        </td>
                        <th style="width:25%">意向型号</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.intentionModel}}</span>
                        </td>


                    </tr>
                    <tr>
                        <th style="width:25%">购买方式</th>
                        <td style="width:25%" class="td-value">
                            <span>{{item.buyType}}</span>
                        </td>
                        <th style="width:25%">购买时间</th>
                        <td style="width:25%" class="td-value">
                            <span>{{changeBuyDate(item.buyDate)}}</span>
                        </td>
                    </tr>
                    <tr v-if="(report.main.title.indexOf('大客户')!=-1)">
                        <th>客户公司</th>
                        <td class="td-value" colspan="3">
                            <span>{{item.companyName}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-value td-row2" style="border-left: none" colspan="4">
                            <span>{{item.otherCondition}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--未达到拜<br>访量原因、当天知道<br>丢单情况、具体情况 visitLetterReason-->
    <table class="table text-center">
        <tr v-if="isHasModule('visitLetterReason')">
            <th style="width:25%;">未达到拜<br>访量原因</th>
            <td class="td-value td-row2">
                <textarea v-if="pageType=='edit'"
                          v-model="report.visitLetterReason.content">
                </textarea>
                <span v-else>{{report.visitLetterReason.content}}</span>
            </td>
        </tr>
        <tr v-if="isHasModule('todayKnowVieSituation')">
            <th>当天知道<br>丢单情况</th>
            <td class="td-row2">
            <span style="display: flex; align-items: center;">
                <label
                        style="margin-left: 0px; margin-bottom: 0px !important;">
                <input type="radio" value="1" v-model="report.todayKnowVieSituation.vieFlag"  class="tdInput"
                       style="margin-left: 5px; float: left;">
            <span style="float: left; height: 20px; line-height: 20px;color: #2a8cec !important;font-weight: 500">
                有竞争丢单
            </span>
            </label>
            <label
                    style="margin-left: 0px; margin-bottom: 0px !important;">
                <input type="radio" value="0" class="tdInput" v-model="report.todayKnowVieSituation.vieFlag"
                       style="margin-left: 20px; float: left;"><span
                    style="float: left; height: 20px; line-height: 20px;color: #2a8cec !important;font-weight: 500">无竞争丢单</span>
            </label>
            </span>
            </td>
        </tr>
        <tr v-if="isHasModule('todayKnowVieSituation')">
            <th>具体情况</th>
            <td class="td-value td-row2">
                <textarea v-if="pageType=='edit'"
                          v-model="report.todayKnowVieSituation.remark">
                </textarea>
                <span v-else>{{report.todayKnowVieSituation.remark}}</span>
            </td>
        </tr>
    </table>
    <!--第二天拜访计划(大客户)-->
    <table class="table text-center" v-if="isHasModule('tomorrowVisitPlan')">
        <tr>
            <th style="border-bottom: none;position:relative;" class="tit">第二天拜访计划(大客户)
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px;">
                <a href="javascript:void(0);" class="a-btn"
                   @click="addRow('tomorrowVisitPlan','TomorrowVisitPlan')">添加一行</a>
                <a href="javascript:void(0);" class="a-btn"
                   @click="delRow('tomorrowVisitPlan')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table  text-center table-border-right-none"
                       v-for="(item,i) in report.tomorrowVisitPlan">
                    <tr>
                        <th style="width:25%" class="jiaobiao"><i></i>客户名称</th>
                        <td style="width:25%" class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.customerName" v-line-inserted="i"
                                   class="txtParent" @click="onfocus1(i)">
                            <span style="font-weight: normal" v-else>{{item.customerName}}</span>
                        </td>
                        <th style="width:25%">上次拜访时间</th>
                        <td class="td-value"
                            style="word-break:break-all;overflow:hidden;max-height:0.24rem;">
                            <input type="text" v-if="pageType=='edit'" v-model="item.lastVisitTime"
                                   @focus="showDatePicker($event,item)">
                            <span style="font-weight: normal;max-height:0.24rem;" v-else>{{item.lastVisitTime}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>客户地点</th>
                        <td class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.customerAddress">
                            <span class="lineOne" v-else>{{item.customerAddress}}</span>
                        </td>
                        <th style="border-bottom: 1px solid #cbcbcd;">客户行业</th>
                        <td class="td-value" style="border-bottom: 1px solid #cbcbcd;">
                            <input type="text" v-if="pageType=='edit'" v-model="item.customerIndustry">
                            <span class="lineOne" v-else>{{item.customerIndustry}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>意向设备</th>
                        <td class="td-value" >
                            <input type="text" v-if="pageType=='edit'" v-model="item.intentionDevice">
                            <span style="font-weight: normal" v-else>{{item.intentionDevice}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>备注</th>
                        <td colspan="3" class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.remake">
                            <span style="font-weight: normal" v-else>{{item.remake}}
                            </span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--未关闭事项跟踪-->
    <table class="table text-center" v-if="isHasModule('unfinishes')">
        <tr>
            <th class="tit">未关闭事项跟踪</th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table text-center table-border-right-none"
                       v-for="(item,i) in report.unfinishes">
                    <tr>
                        <th style="width:25%" class="td-title1 jiaobiao"><i></i>工作内容</th>
                        <td class="td-value"><span>{{item.trackContent}}</span></td>
                    </tr>
                    <tr>
                        <th class="td-title1">进展情况</th>
                        <td class="td-value">{{item.jinzhan}}</td>
                    </tr>
                    <tr>
                        <th class="td-title1">预计关闭时间</th>
                        <td class="td-value">{{item.overTime}}</td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当天收款情况-->
    <table class="table text-center" v-if="isHasModule('todayGatherSituation')">
        <tr>
            <th class="tit" style="position: relative">当天收款情况
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px;">
                            <a href="javascript:void(0);" class="a-btn"
                               @click="addRow('todayGatherSituation','Gather')">添加一行</a>
                        <a href="javascript:void(0);" class="a-btn"
                           @click="delRow('todayGatherSituation')">删除一行</a>
                        </span>
            </th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table  text-center" v-for="(item,i) in report.todayGatherSituation">
                    <tr class="td-title2">
                        <th style="width:25%" class="jiaobiao"><i></i>客户名称</th>
                        <td style="width:25%" class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.customerName"
                                   style="text-align: center !important;">
                            <span v-else>{{item.customerName}}</span>
                        </td>
                        <th style="width:25%">收款性质</th>
                        <td class="td-value">
                            <select v-if="pageType=='edit'" v-model="item.gatherType">
                                <option v-for="option in gathering" v-bind:value="option.value">
                                    {{option.text}}
                                </option>
                            </select>
                            <span v-else>{{item.gatherType}}</span>
                        </td>
                    </tr>
                    <tr class="td-title2">
                        <th>收款金额</th>
                        <td class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.money"
                                   style="text-align: center !important;">
                            <span v-else>{{item.money}}</span>
                        </td>
                        <th>打款银行</th>
                        <td class="td-value">
                            <input type="text" v-if="pageType=='edit'" v-model="item.bank"
                                   style="text-align: center !important;">
                            <span v-else>{{item.bank}}</span>
                        </td>
                    </tr>
                    <tr class="td-title2">
                        <th td-title2>收款情况<br>说明</th>
                        <td colspan="3" class="td-value">
                            <textarea v-if="pageType=='edit'"
                                      v-model="item.remark"></textarea>
                            <span v-else>{{item.remark}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--今日下属工作情况描述 大区经理-->
    <table class="table  table-bordered text-center" v-if="isHasModule('subordinateTodayWork')">
        <tr>
            <th style="border-bottom: none; " class="tit"><span>今日下属工作情况描述</span></th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table text-center" v-for="(item,i) in report.subordinateWorkList">
                    <tr class="td-title2">
                        <th style="border-left: none;width: 25%;" class="jiaobiao"><i></i>区域</th>
                        <td colspan="3" style="border-left: none;border-left: 1px solid #cbcbcd;" class="td-value">
                            <span style="color: #0c0c0c !important;text-align: left !important;display: inherit;padding-left: 2px;">{{item.regionName}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 25%;border-left: none !important;">区域经理</th>
                        <td style="width: 25%;">
                            <span class="oa-name">{{item.reiongManagerName}}</span>
                            <span v-if="item.dayNumber"
                                  style="width: 45px;float: left;  font-size: 12px;   text-align: left !important;  display: block;    line-height: 24px;  height: 24px;">
                                 ({{item.dayNumber}})
                            </span>
                        </td>
                        <th style="width: 25%;">是否陪跑</th>
                        <td style="width: 25%;" class="td-value">
                            <select style="padding: 30px;" v-if="pageType=='edit'&&item.reiongManagerId">
                                <option value="否">否</option>
                                <option value="是">是</option>
                            </select>
                            <span v-else style="text-align: center;color: #2a8cec;">{{item.haveAccompany}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="border-left: none !important;">情况描述</th>
                        <td colspan="3" class="td-value td-row2" style="border-right: hidden">
                            <textarea v-model="item.content" v-if="pageType=='edit'"></textarea>
                            <span v-else>{{item.content}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--今日下属工作情况描述 区域总监-->
    <table class="table  table-bordered text-center" v-if="isHasModule('regionDirectorTodayWork')">
        <tr>
            <th style="border-bottom: none; " class="tit"><span>今日下属工作情况描述</span></th>
        </tr>
        <tr>
            <td class="bd_none">
                <table class="table text-center" v-for="(item,i) in report.regionDirectorWorkList">
                    <tr class="td-title2">
                        <th style="width: 25%;border-left: none;border-right: 1px solid #cbcbcd;" class="jiaobiao">
                            <i></i>大区
                        </th>
                        <td style="width: 25%;border-left: none;text-align: center !important;" class="td-value"><span
                                style="color:#333 !important;">{{item.regionName}}</span>
                        </td>
                        <th style="width: 25%;">大区经理</th>
                        <td style="width: 25%;">
                            <span class="oa-name">{{item.reiongManagerName}}</span>
                            <span v-if="item.dayNumber"
                                  style="width: 45px;float: left;  font-size: 12px;   text-align: left !important;  display: block;    line-height: 24px;  height: 24px;">
                                 ({{item.dayNumber}})
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="1" style="border-left: none !important;">情况描述</th>
                        <td colspan="3" class="td-value td-row2">
                            <textarea v-model="item.content" v-if="pageType=='edit'"></textarea>
                            <span v-else>{{item.content}}</span>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--当日费用明细-->
    <table class="table text-center table-bordered" v-if="isHasModule('todayCostDetail')" style="margin-bottom: 50px !important;">
        <tr>
            <th class="tit" style="position: relative;">当日费用明细
                <span class="span-a-btn" v-if="pageType=='edit'" style="top: 4px;">
                    <a href="javascript:void(0);" class="a-btn"
                       @click="addRow('todayCostDetail2','Cost')">添加一行</a>
                    <a href="javascript:void(0);" class="a-btn"
                       @click="delRow('todayCostDetail2')">删除一行</a>
                </span>
            </th>
        </tr>
        <tr>
            <td class="bd_none">
                <!--当日已通过的临时费用-->
                <table class="table text-center" v-for="(item,i) in report.todayCostDetail">
                    <tr class="td-title2">
                        <th class="jiaobiao" style="width:25%"><i></i>费用名称</th>
                        <td style="text-align: left;padding-left: 0.1rem;width:25%"
                            class="td-value">
                            <span style="font-weight: normal">{{item.costSmallName}}</span>
                        </td>
                        <th style="width:25%">金额</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="number" style="text-align: center"
                                   v-model="item.money" readonly="readonly"/>
                            <span v-else>{{item.money}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">有无发票</th>
                        <td style="width:25%" class="td-value">
                            <span v-if="item.invoiceFlag=='1'">有</span>
                            <span v-else>无</span>
                        </td>
                        <th style="width:25%">状态</th>
                        <td style="width:25%" class="td-value">
                            <span v-if="item.auditFlag=='0'">审核中</span>
                            <span v-if="item.auditFlag=='1'">审核通过</span>
                            <span v-if="item.auditFlag=='2'">驳回</span>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="1">说明</th>
                        <td colspan="2" class="td-value td-row2" style="border-right: hidden">
                            <span>{{item.remark}}</span>
                        </td>
                        <td>
                            <input type="button"
                                   style="float: right;width: 40px;height: 20px;padding-left: 6px;padding-right: 6px;padding-bottom: 0px;padding-top: 0px;"
                                   class="oaBtn btn-primary" @click="gotoDetail(item)" value="查看"/>
                        </td>
                    </tr>
                </table>
                <!--当日申请的临时费用-->
                <table class="table text-center" v-for="(item,i) in report.todayCostDetail2">
                    <tr class="td-title2">
                        <th class="jiaobiao" style="width:25%"><i></i>费用名称</th>
                        <td style="text-align: left;padding-left: 0.1rem;width:25%"
                            class="td-value">
                            <template v-if="pageType=='edit'">
                                <input @click="openExpense(i)"  type="text" readonly  v-model="item.costSmallName"
                                       style="text-align: left;text-align: center !important;"/>
                            </template>
                            <span v-else  style="font-weight: normal">{{item.costSmallName}}</span>
                        </td>
                        <th style="width:25%">金额</th>
                        <td style="width:25%" class="td-value">
                            <input v-if="pageType=='edit'" type="number" style="text-align: center"
                                   v-model="item.money"/>
                            <span v-else>{{item.money}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="width:25%">有无发票</th>
                        <td class="td-value" style="width:25%">
                            <select v-if="pageType=='edit'" v-model="item.invoiceFlag" class="haveInvoice"
                                    style="padding-left: 35px">
                                <option v-for="option in invoiceFlagList" v-bind:value="option.value">
                                    {{ option.text }}
                                </option>
                            </select>
                            <span v-else>{{getInvoiceFlagName(item.invoiceFlag)}}</span>
                        </td>
                        <th style="width:25%">状态</th>
                        <td style="width:25%" class="td-value"></td>
                    </tr>
                    <tr>
                        <th style="border-bottom: 1px solid #cbcbcd;">说明</th>
                        <td colspan="5" class="td-value td-row2"
                            style="border-bottom: 1px solid #cbcbcd;">
                            <textarea v-if="pageType=='edit'" type="text" v-model="item.remark"></textarea>
                            <span v-else>{{item.remark}}</span>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>
    <div class="saveModle">
        <div class="top" style="background-color: #F8F8F8">
            <div class="title">选择人员</div>
            <div class="btn" v-on:click="closeModle"> x</div>
        </div>
        <div id="header" class="header box-body" style="padding: 25px 20px;padding-bottom: 0;">

            <div class="form-group">
                <label id="aReceivers" tabindex="-1">收件人</label>
                <div class="userbox form-control" id="receivers"
                     v-on:click.stop="inputFocus('txtReceiver')">
                    <div v-for="(user,i) in report.receivers" class="user"
                         v-bind:class="{ select:receiverSelectedIdx==i }"
                         v-on:click="selectUser(i,'receiverSelectedIdx')">{{user.userName}};
                    </div>
                    <input type="text" id="txtReceiver"
                           @keyup.delete="deleteUser('receivers','receiverSelectedIdx',$event)"/>
                </div>
            </div>
            <div class="form-group">
                <label for="txtCopier" id="aCopiers" tabindex="-1">抄送人</label>
                <div class="userbox form-control" id="copiers"
                     v-on:click.stop="inputFocus('txtCopier')">
                    <div v-for="(user,i) in report.copiers" class="user"
                         v-bind:class="{ select: copierSelectedIdx == i }"
                         v-on:click="selectUser(i,'copierSelectedIdx')">{{user.userName}};
                    </div>
                    <input type="text" id="txtCopier"
                           @keyup.delete="deleteUser('copiers','copierSelectedIdx',$event)"/>
                </div>
            </div>
        </div>
        <input type="button" value="发送" class="saveBtn btn oaBtn" @click="saveGo">
    </div>
    <div class="saveExpense">
        <div class="top">
            <div class="title">费用名称</div>
            <div class="btn" v-on:click="closeExense"> x</div>
        </div>
        <div class="header box-body" style="padding: 25px 20px;padding-bottom: 0;">
            <div class="form-group" style="overflow: hidden">
                <div class="expenseTitle" style="letter-spacing: 3px;">一级费用名称</div>
                <select v-if="pageType=='edit'"  style=" padding-left: 19px;" v-model="costBigId" class="expenseValue"
                        @change="getExpenseChildName()">
                    <option v-for="option in costBigNameList" v-bind:value="option.id">
                        {{option.name}}
                    </option>
                </select>
            </div>
            <div class="form-group" style="overflow: hidden">
                <div class="expenseTitle" style="letter-spacing: 3px;">二级费用名称</div>
                <select v-if="pageType=='edit'" style=" padding-left: 19px;" v-model="costSmallId" class="expenseValue"
                        @change="getExpenseSmallName()">
                    <option v-for="option in costSmallNameList" v-bind:value="option.id">
                        {{option.name}}
                    </option>
                </select>
            </div>
        </div>
        <input type="button" value="确定" class="saveBtn btn oaBtn" @click="saveExpenseBtn">
    </div>
    <div class="modleBj"></div>
    <!--报告评价-->
    <table class="table text-center" v-if="isLook=='pingjia'&&pingjiaFlag=='true'"
           style="margin-bottom: 15px !important;">
        <tr>
            <th class="tit">报告评价</th>
        </tr>
        <tr>
            <td class="bd_none">
                <div v-if="isLook=='pingjia'">
                    <table class="table  table-bordered text-center">
                        <tr>
                            <td class="td-title width90" style="width:25%">是否合格</td>
                            <td>
                                <div style="float: left;width: 50%;text-align: center;position: relative">
                                    <i :class="pingjia.evaluation=='合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                                       v-if="isComment=='0'"
                                       @click="changeEvaluation('合格')"></i>
                                    <span class="evaluation" v-if="isComment=='0'"
                                          :style="pingjia.evaluation!='合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'"
                                          @click="changeEvaluation('合格')">合格<i
                                            style="display: inline-block;width: 100%;height: 0;"></i></span>
                                    <template v-else>
                                        <i :class="pingjia.evaluation=='合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                                           v-if="pingjia.evaluation=='合格'"></i>
                                        <span class="evaluation" v-if="pingjia.evaluation=='合格'"
                                              :style="pingjia.evaluation!='合格'?'color: #bcb8b8 !important;':'color:  #fff !important;background: rgb(42, 140, 236)'">合格<i
                                                style="display: inline-block;width: 100%;height: 0;"></i></span>
                                    </template>
                                </div>
                                <div style="float: left;width: 50%;text-align: center;position: relative">
                                    <i :class="pingjia.evaluation=='不合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                                       v-if="isComment=='0'"
                                       @click="changeEvaluation('不合格')"></i>
                                    <span class="evaluation"
                                          v-if="isComment=='0'"
                                          :style="pingjia.evaluation!='不合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'"
                                          @click="changeEvaluation('不合格')">不合格<i
                                            style="display: inline-block;width: 100%;height: 0;"></i></span>
                                    <template v-else>
                                        <i :class="pingjia.evaluation=='不合格'?'icon_wj icon_active_radio':'icon_wj icon_radio'"
                                           v-if="pingjia.evaluation=='不合格'"></i>
                                        <span class="evaluation" v-if="pingjia.evaluation=='不合格'"
                                              :style="pingjia.evaluation!='不合格'?'color: #bcb8b8 !important;':'color: #fff !important;background: rgb(42, 140, 236)'">不合格<i
                                                style="display: inline-block;width: 100%;height: 0;"></i></span>
                                    </template>
                                </div>
                            </td>
                        </tr>
                        <!--<tr>-->
                        <!--<td class="td-title width90 td-row2" style="width:25%">评价参考</td>-->
                        <!--<td class="td-row2 " style="vertical-align: top;">-->
                        <!--<template>-->
                        <!--<div class="pingjia"-->
                        <!--v-for="item in pingjia.pingjia">-->
                        <!--{{item.value}}-->
                        <!--</div>-->
                        <!--</template>-->
                        <!--&lt;!&ndash;<template v-else>&ndash;&gt;-->
                        <!--&lt;!&ndash;<div :class="item.select!='0'?'pingjia_active':'pingjia'" v-if="item.select!='0'"&ndash;&gt;-->
                        <!--&lt;!&ndash;v-for="item in pingjia.pingjia">&ndash;&gt;-->
                        <!--&lt;!&ndash;{{item.value}}&ndash;&gt;-->
                        <!--&lt;!&ndash;</div>&ndash;&gt;-->
                        <!--&lt;!&ndash;</template>&ndash;&gt;-->
                        <!--</td>-->
                        <!--</tr>-->
                        <tr>
                            <td class="td-title width90 td-row2" style="width:25%">评价描述</td>
                            <td class="td-row2" v-if="isComment=='0'" style="color: #2a8cec">
                                <textarea v-model="pingjia.otherDescription"></textarea>
                                <!--<div style="display:inline">-->
                                <button type="button"
                                        style="float: right;width: 40px;height: 20px;padding-left: 6px;padding-right: 6px;padding-bottom: 0px;padding-top: 0px;"
                                        class="oaBtn"
                                        @click="comment()">提交
                                </button>
                                <!--</div>-->
                            </td>
                            <td class="td-value td-row2" v-else>
                    <span style="text-align: left;padding-left: 20px;"
                          class="lineOne">{{pingjia.otherDescription}}</span>
                            </td>
                        </tr>

                    </table>
                </div>
            </td>
        </tr>
    </table>
    <div class="oa-footer-btns" v-if="report.main.flage == '-1'&& endLoad =='true'&&editable=='true'">
        <div v-if="pageType=='edit'" @click="saveTraft">保存草稿</div>
        <div v-if="pageType=='edit'&&(editable=='true'||userId == '20181225140445CD827D94AF9A96C367')" @click="OpenModle">发送</div>
        <i></i>
    </div>
    <div class="oa-footer-btn" style=""
         v-if="endLoad =='true'&&report.main.flage != '-1'&&pageType=='edit'&&(editable=='true'||userId == '20181225140445CD827D94AF9A96C367')"
         @click="OpenModle"
    >
        发送
    </div>
    <div class="oa-footer-btn" style=""
         v-if="endLoad =='true'&&report.main.flage == '-1'&&pageType=='edit'&&editable!='true'"
         @click="saveTraft"
    >
        保存草稿
    </div>
    <!--<input type="button" v-if="pageType=='edit' && report.main.flage == '-1'"-->
    <!--style="width:100px;margin-top: -4px;"-->
    <!--value="保存草稿"-->
    <!--class="btn oaBtn btn-xs" @click="saveTraft"/>-->
    <!--<input type="button" style="width:100px;margin-top: -4px;"-->
    <!--v-if="pageType=='edit'&&(editable=='true'||userId == '20181225140445CD827D94AF9A96C367')"-->
    <!--value="发送"-->
    <!--class="btn oaBtn btn-xs" @click="OpenModle"/>-->
    <!--<span v-if="pageType=='edit' && editable!='true' && userId != '20181225140445CD827D94AF9A96C367' "-->
    <!--style="color:red;font-size:12px;">注：16:30前只能保存草稿</span>-->

</section>

<!--rem.js-->
<script src="/dist/js/pages/rem/rem.js"></script>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script src="/dist/js/oaApp.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
    Date.prototype.addDays = function (d) {
        this.setDate(this.getDate() + d);
    };
</script>
<script type="text/javascript">
    function getUrlParamObj() {
        var args = new Object();
        var query = location.href;
        var pairs = query.split("&"); //www.cxybl.com break at ampersand
        for (var i = 0; i < pairs.length; i++) {
            var pos = pairs[i].indexOf('='); // look for "name=value"
            if (pos == -1) continue; // if not found, skip
            var argname = pairs[i].substring(0, pos); // extract the name
            var pos1 = argname.indexOf('?');
            if (pos1 > -1) {
                argname = argname.substring(pos1 + 1);
            }
            var value = pairs[i].substring(pos + 1); // extract the value
            value = decodeURIComponent(value); // decode it, if needed
            args[argname] = value; // store as a property
        }
        var ss = args.valueOf(0);
        obj = args;
        return args;
    }

    var app = new Vue({
        el: '#app',
        data: {
            costSmallName:'',
            costBigName:'',
            costBigId:'',
            costSmallId:'',
            trackParams: {
                userId: '',
                userName: ''
            },
            userInfo: {},
            checkMore: 'gengduo',
            commentList: [],
            userType: '1',
            pingjiaFlag: "false",
            faceTarget: '0',
            commentTitle: "",
            commentTishi: "",
            endLoad: '',
            pingjia: {
                evaluation: "",
                pingjia: [],
                pingjiaList: [],
                pingjiaStrings: "",
                otherDescription: "",
                createUserId: getUrlParamObj().userId,
                createUserName: getUrlParamObj().userName,
            },
            userId:getUrlParamObj().userId,
            isLook: getUrlParamObj().isLook,
            isComment: getUrlParamObj().isComment ? getUrlParamObj().isComment : '0',
            pageType: 'edit',    //如果pageType=edit说明是编辑页面，如果pagetype=browser，说明是查看页面
            leaderFlag: getUrlParamObj().leaderFlag,
            editable:getUrlParamObj().editable,
            flage: getUrlParamObj().flage,
            dateReissueEnd: getUrlParamObj().dateReissueEnd,
            cusSource: [
                {text: '销售录入', value: '销售录入'},
                {text: '易企秀', value: '易企秀'},
                {text: '400', value: '400'},
                {text: '其他', value: '其他'}
            ],
            gathering: [
                {text: '银行欠款', value: '银行欠款'},
                {text: '配件欠款', value: '配件欠款'},
                {text: '首付垫款', value: '首付垫款'},
                {text: '以租代售租金', value: '以租代售租金'},
                {text: '服务费', value: '服务费'},
                {text: '银行垫款', value: '银行垫款'},
                {text: '以租代售的定金', value: '以租代售的定金'},
                {text: '其他', value: '其他'}
            ],
            inferiorNameList: [],
            templates: [],
            currentUserTel: '',
            buyDateList: [
                {text: '一周', value: '一周'},
                {text: '本月', value: '本月'}
            ],
            buyTypeList: [
                {text: '全款', value: '全款'},
                {text: '内部分期', value: '内部分期'},
                {text: '融资', value: '融资'}
            ],
            visitModelList: [
                {text: '面访', value: '1'},
                {text: '电访', value: '0'}
            ],
            invoiceFlagList: [
                {text: '无', value: '0'},
                {text: '有', value: '1'}
            ],
            visitModelList: [
                {text: '1', value: '1'},
                {text: '0', value: '0'}
            ],
            visitGoalList: [
                {text: '首次拜访', value: '首次拜访'},
                {text: '重复拜访', value: '重复拜访'},
                {text: '意向跟踪', value: '意向跟踪'},
                {text: '扫村扫街', value: '扫村扫街'}
            ],
            visitBigGoalList: [
                {text: '意向跟踪', value: '意向跟踪'},
                {text: '陪同跑动', value: '陪同跑动'},
                {text: '其它', value: '其它'},
                {text: '扫村扫街', value: '扫村扫街'}
            ],
            invoiceFlagList: [
                {text: '无', value: '0'},
                {text: '有', value: '1'}
            ],
            serverCustomerType: [],
            feeType: [],
            customerType: [],
            serverVisitType: [],
            debtVisitType: [],
            lettersVisitType: [],
            report: {
                tomorrowVisitPlan: [],
                receivers: [],
                copiers: [],
                subordinateWorkList: [],
                regionDirectorWorkList: [],
                main: {
                    id: '0',
                    title: '',
                    reportDate: this.reportDate,
                    userId: '',
                    moduleENames: "",
                    flage: '-1',
                    draft: 0
                },
                experience: {content: '', type: 1},//心得体会
                tomorrowAMPlan: {content: '', type: 6},//次日上午计划
                tomorrowPMPlan: {content: '', type: 7},//次日下午计划
                tomorrowPlan: {content: '', type: 3},//第二天计划
                personSituation: {content: '', type: 2},//人员情况
                troubleShooting: [//未处理前三个疑难故障
                    new Template.Unfinish('1'),
                    new Template.Unfinish('1'),
                    new Template.Unfinish('1')
                ],
                visitLetterReason: {content: '', type: 9},//未达到拜访量原因
                todayKnowVieSituation: {id: '', wId: '', vieFlag: '', remark: ''},//丢单原因
                forSupportMatters: [//需要公司支持的事项
                    new Template.Unfinish('2')
                ],
                workOnTodayDescs: [//当日工作情况描述
                    new Template.WorkOnTodayDesc()
                ],
                workOnTodayDescsZjlNew: {
                    saleList: [new Template.WorkOnTodayDescsZjl()],
                    serverList: [new Template.WorkOnTodayDescsZjl()],
                    financeList: [new Template.WorkOnTodayDescsZjl()],
                    diconList: [new Template.WorkOnTodayDescsZjl()],
                    bondList: [new Template.WorkOnTodayDescsZjl()],
                    personList: [new Template.WorkOnTodayDescsZjl()],
                },
                unfinishes: [//未关闭事项
                    new Template.Unfinish('3')
                ],
                todayCustomerVisit: [//当日拜访情况(面访)
                    new Template.CustomerSaler()
                ],
                todayCustomerTelVisit: [//当日拜访情况(电访)
                    new Template.CustomerSalerTel()
                ],
                todayVisitCustomer: [//当日拜访情况(拜访)
                    new Template.CustomerSalerVisit()
                ],
                todayVisitCustomerBigRegion: [//当日拜访情况(大区拜访)
                    new Template.CustomerSalerVisitRegion()
                ],
                todayCostDetail: [//当日费用明细
                    new Template.Cost()
                ],
                todayCostDetail2: [//当日费用明细
                    new Template.Cost()
                ],
                jobDescriptionForBranch: [//下属工作情况-大区经理
                    new Template.Branch()
                ],
                todayGatherSituation: [//当天收款情况
                    new Template.Gather()
                ]
            },
            costBigNameList: [],
            costSmallNameList:[],
            receiverSelectedIdx: -1,
            copierSelectedIdx: -1,
            currentfocus: 0,
            entourage: [],
            provinceList: [],
            cityList: [],
            countyList: [],
            type: getUrlParamObj().type
        },
        methods: {
            closeModle: function () {
                $(".modleBj").hide();
                $(".saveModle").hide();
            },
            showLoading: function () {
                var that = this
                var param = {
                    cancelable: false
                }
                JSBridge.call(UI, 'showLoading', param)
            },
            hideLoading: function () {
                JSBridge.call(UI, 'hideLoading')
            },
            getWeek: function () {
                var that = this;
                const week = [];
                for (var i = 0; i < 6; i++) {
                    var Stamp = new Date();
                    var num = 7 - Stamp.getDay() + 1 + i;
                    Stamp.setDate(Stamp.getDate() + num);
                    var mvar = '';
                    if ((Stamp.getMonth() + 1) > 10) {
                        mvar = (Stamp.getMonth() + 1);
                    } else {
                        mvar = '0' + (Stamp.getMonth() + 1);
                    }
                    var dvar = '';
                    if (Stamp.getDate() < 10) {
                        dvar = '0' + Stamp.getDate();
                    } else {
                        dvar = Stamp.getDate() + '';
                    }
                    if ((Stamp.getMonth() + 1) > 10) {
                    } else {
                    }
                    week[i] = Stamp.getFullYear() + '-' + mvar + '-' + dvar;
                    console.log(week[i]);
                }
                that.week = week;
            },
            initData: function () {
                var that = this;
                that.getWeek();
                var tomorrowVisitPlan = [
                    {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "county": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "county": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "county": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "county": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    },
                    {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }, {
                        "createTime": "",
                        "county": "",
                        "createUserId": getCurrentUser().id,
                        "customerAddress": "",
                        "customerIndustry": "",
                        "customerName": "",
                        "id": 0,
                        "intentionDevice": "",
                        "lastVisitTime": "",
                        "remake": "",
                        "visitMethod": "",
                        "visitGoal": "",
                        "entourage": "",
                    }
                ]
                that.report.tomorrowVisitPlan = tomorrowVisitPlan;
            },
            removeNull: function () {
                var list = this.report;
                for (var i = list.workOnTodayDescs.length - 1; i >= 0; i--) {
                    if (list.workOnTodayDescs[i].content == "") {
                        list.workOnTodayDescs.splice(i, 1);
                    }
                }
                if (list.workOnTodayDescsZjlNew) {
                    for (var i = list.workOnTodayDescsZjlNew.saleList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.saleList[i].content == "") {
                            list.workOnTodayDescsZjlNew.saleList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.serverList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.serverList[i].content == "") {
                            list.workOnTodayDescsZjlNew.serverList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.financeList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.financeList[i].content == "") {
                            list.workOnTodayDescsZjlNew.financeList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.diconList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.diconList[i].content == "") {
                            list.workOnTodayDescsZjlNew.diconList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.bondList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.bondList[i].content == "") {
                            list.workOnTodayDescsZjlNew.bondList.splice(i, 1);
                        }
                    }
                    for (var i = list.workOnTodayDescsZjlNew.personList.length - 1; i >= 0; i--) {
                        if (list.workOnTodayDescsZjlNew.personList[i].content == "") {
                            list.workOnTodayDescsZjlNew.personList.splice(i, 1);
                        }
                    }
                }

                for (var i = list.todayGatherSituation.length - 1; i >= 0; i--) {
                    if (list.todayGatherSituation[i].money == "") {
                        list.todayGatherSituation.splice(i, 1);
                    }
                }

                for (var i = list.todayCostDetail.length - 1; i >= 0; i--) {
                    if (list.todayCostDetail[i].money == "") {
                        list.todayCostDetail.splice(i, 1);
                    }
                }
                for (var i = list.unfinishes.length - 1; i >= 0; i--) {
                    if (list.unfinishes [i].trackContent == "") {
                        list.unfinishes.splice(i, 1);
                    }
                }
                return list;
            },
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            inputFocus: function (id) {
                $("#" + id).focus();
            },
            selectUser: function (i, prop) {
                this.receiverSelectedIdx = -1;
                this.copierSelectedIdx = -1;
                this[prop] = i;
            },
            deleteUser: function (prop, idx, event) {
                if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                    if (this[idx] > -1) {
                        var userId = this.report[prop][this[idx]].userId;
                        // if (this.deleteList.indexOf(this.report[prop][this[idx]].userId) == -1) {
                        this.report[prop].splice(this[idx], 1);
                        this.receiverSelectedIdx = -1;
                        this.copierSelectedIdx = -1;
                        for (var i = 0; i < this.report.handAddReceivers.length; i++) {
                            if (this.report.handAddReceivers[i].userId == userId) {
                                this.report.handAddReceivers.splice(i, 1);
                            }
                        }
                        for (var i = 0; i < this.report.handAddCopiers.length; i++) {
                            if (this.report.handAddCopiers[i].userId == userId) {
                                this.report.handAddCopiers.splice(i, 1);
                            }
                        }
                        //  }
                        this.receiverSelectedIdx = -1;
                        this.copierSelectedIdx = -1;
                    } else {
                        this[idx] = this.report[prop].length - 1;
                    }
                }
            },
            getNextDate: function (date, day) {
                var dd = new Date(date);
                dd.setDate(dd.getDate() + day);
                var y = dd.getFullYear();
                var m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
                var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
                return y + "-" + m + "-" + d;
            },
            getEntourage: function (event, i, type) {
                var that = this;
                var visitGoal = that.report.tomorrowVisitPlan[i].visitGoal;
                console.log(visitGoal)
                if (visitGoal == '陪同跑动' || visitGoal == '意向跟踪' || visitGoal == '其它' || visitGoal == '首次拜访' || visitGoal == '重复拜访' || visitGoal == '扫村扫街') {
                    var inputId = '#entourage' + i
                    $(inputId).attr("readonly", "readonly");
                    that.showDivEntourage(event, type);
                }
            },
            onfocus1: function (i) {
                var that = this;
                that.currentfocus = i;
            },
            addRow: function (prop, template) {
                if (prop == "forSupportMatters") {
                    this.report[prop].push(new Template.Unfinish('1'));
                } else if (prop == "unfinishes") {
                    this.report[prop].push(new Template.Unfinish('1'));
                } else if (prop == "tomorrowVisitPlan2") {
                    this.report.tomorrowVisitPlan.push(new Template[template]());
                } else if (prop == "saleList" || prop == "serverList" || prop == "financeList" || prop == "diconList" || prop == "bondList" || prop == "personList") {
                    this.report.workOnTodayDescsZjlNew[prop].push(new Template[template]());
                } else {
                    this.report[prop].push(new Template[template]());
                }
            },
            delRow: function (prop) {
                if (prop == "tomorrowVisitPlan2") {
                    this.report.tomorrowVisitPlan.splice(this.report.tomorrowVisitPlan.length - 1, 1);
                } else if (prop == "saleList" || prop == "serverList" || prop == "financeList" || prop == "diconList" || prop == "bondList" || prop == "personList") {
                    if (this.report.workOnTodayDescsZjlNew[prop].length == 1) {
                        this.appPopout("请保留最少一行")
                    } else {
                        this.report.workOnTodayDescsZjlNew[prop].splice(this.report.workOnTodayDescsZjlNew[prop].length - 1, 1);
                    }
                } else {
                    this.report[prop].splice(this.report[prop].length - 1, 1);
                }


            },
            clearData: function (i) {
                this.report.tomorrowVisitPlan[i].customerName = "";
            },
            showDivEntourage: function (event, type) {
                console.log(event)
                this.divInEntourage = type;
                $("#entourage").css({
                    "left": event.pageX,
                    "top": (event.pageY) + "px"
                }).show();
            },
            addEntourage: function (a, type) {
                var that = this;
                if (type == 'tomorrowVisitPlan') {
                    that.report.tomorrowVisitPlan[that.currentfocus].customerName = a;
                }
                if (type == 'tomorrowVisitPlanBigRegion') {
                    that.report.tomorrowVisitPlan[that.currentfocus].entourage = a;
                }
                if (type == 'tomorrowVisitPlanRegion') {
                    that.report.tomorrowVisitPlan[that.currentfocus].entourage = a;
                }
                that.report.tomorrowVisitPlan.push({});
                that.report.tomorrowVisitPlan.splice(that.report.tomorrowVisitPlan.length - 1, 1);
                $("#entourage").hide();
            },
            showDatePicker: function (e, item) {
                WdatePicker({
                    onpicked: function (dp) {
                        item.overTime = dp.cal.getNewDateStr();
                        item.lastVisitTime = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            closeModle: function () {
                $(".modleBj").hide();
                $(".saveModle").hide();
            },
            saveExpenseBtn: function () {
                var that = this
                var index = $(".saveExpense").attr("data-index");
                that.report.todayCostDetail2[index].costBigId = that.costBigId;
                that.report.todayCostDetail2[index].costSmallId = that.costSmallId;
                console.log(that.costSmallName)
                that.report.todayCostDetail2[index].costSmallName = that.costSmallName;
                that.report.todayCostDetail2[index].costBigName = that.costBigName;
                console.log(that.report.todayCostDetail2[index])
                $(".modleBj").hide();
                $(".saveExpense").hide();
                that.costBigId = '';
                that.costSmallId = '';
                that.costSmallName = '';
                that.costBigName = '';
            },
            closeExense: function () {
                $(".modleBj").hide();
                $(".saveExpense").hide();
            },
            openExpense: function (index) {
                var that =this
                $(".modleBj").show();
                $(".saveExpense").show();
                $(".saveExpense").attr("data-index", index);
            },
            getExpenseChildName: function () {
                var index = $(".saveExpense").attr("data-index");
                var that = this;
                for (var i = 0; i < this.costBigNameList.length; i++) {
                    if (this.costBigNameList[i].id == this.costBigId) {
                        this.costBigNameList[index].costBigName = this.costBigNameList[i].name;
                        this.costBigName = this.costBigNameList[i].name;
                    }
                }
                $.ajax({
                    url: server.ip + "/wreport/getExpenseByParentId.json",
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({parentId: that.costBigId, userId: getUrlParamObj().userId}),
                    success: function (r) {
                        var res = r;
                        that.costSmallNameList = res.data.sendData;
                        that.costBigNameList[index].costSmallNameList = res.data.sendData;
                    },
                    error: function () {
                        this.appPopout("获取费用名称出错")
                    }
                })
            },
            getExpenseSmallName: function () {
                var that = this;
                var index = $(".saveExpense").attr("data-index");
                console.log(that.costBigNameList[index].costSmallNameList)
                console.log(that.costSmallId)
                for (var i = 0; i < that.costBigNameList[index].costSmallNameList.length; i++) {
                    if (that.costBigNameList[index].costSmallNameList[i].id == that.costSmallId) {
                        that.costBigNameList[index].costSmallName = that.costBigNameList[index].costSmallNameList[i].name;
                        that.costSmallName = that.costBigNameList[index].costSmallNameList[i].name;
                    }
                }
            },
            getCity: function (id) {
                var that = this;
                $.ajax({
                    url: server.ip + '/intentCustomer/getForProvinceById.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({
                        'id': id,
                    }),
                    success: function (r) {
                        var res = JSON.parse(r)
                        that.cityList = res.data.sendData.records
                    },
                    error: function (e) {
                        this.appPopout(e.responseText)
                    }
                }, true);
            },
            getCounty: function (id) {
                var that = this;
                $.ajax({
                    url: server.ip + '/intentCustomer/getForProvinceById.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({
                        'id': id,
                    }),
                    success: function (r) {
                        var res = r
                        that.countyList = res.data.sendData.records
                    },
                    error: function (e) {
                        this.appPopout(e.responseText)
                    }
                }, true);
            },
            goIntent: function (i, item) {
                var that = this
                if (item.intentionFlag == '1') {
                    var index = i;
                    var itemCus = item;
                    console.log(i, item)
                    itemCus.createUserId = getUrlParamObj().userId
                    $.ajax({
                        url: server.ip + "/wreportCustomer/save.json",
                        contentType: 'application/json;charset=utf-8',
                        type: "POST",
                        data: JSON.stringify(trimRN(itemCus)),
                        success: function (r) {
                            console.log(r.data.sendData.id)
                            itemCus.customerId = r.data.sendData.id;
                            if (itemCus.customerId && itemCus.customerId != '') {
                                var param = {
                                    title: '意向客户详情',
                                    url:'/page/intentionManagement/quYuIntentionalDetailApp.html?customerId=' + itemCus.customerId + '&isAdd=0'+ '&pageType=edit' + '&userId=' + getUrlParamObj().userId + '&companyId=' + that.userInfo.companyId + '&isRegion=1'+'&type=android'+'&newPager=1'+'&report=2'+'&index=' + index,
                                }
                                JSBridge.call(ROUTER, 'navigateTo', param)
                            }
                        },
                        error: function () {
                            this.appPopout("获取费用名称出错")
                        }
                    })
//                    $.wyui.postMethod('/wreportCustomer/save.json', trimRN(itemCus), function (r) {
//                        var res = rr.data.sendData
//                        console.log(res.id)
//                    })
                }
            },
            findCusByTel: function (customer) {
                if(customer.tel){
                    customer.tel = customer.tel.replaceAll(" ", "")
                    var that = this;
                    $.ajax({
                        url: server.ip + "/wreport/getCustomerByTel.json",
                        contentType: 'application/json;charset=utf-8',
                        type: "POST",
                        data: JSON.stringify({tel: customer.tel}),
                        success: function (r) {
                            if (!r.e.code && r.data.sendData) {
                                var data = r.data.sendData;
                                customer.customerId = data.id;
                                for (var p in data) {
                                    console.log(p)
                                    customer[p] = data[p];
                                }
                            }
                        }
                    });
                }
            },
            checkMore1: function () {
                var that = this
                if (that.checkMore == 'shouqi') {
                    that.checkMore = 'gengduo'
                } else {
                    that.checkMore = 'shouqi'
                }
            },
            getInvoiceFlagName: function (invoiceFlag) {
                var name = "";
                for (var i = 0; i < this.invoiceFlagList.length; i++) {
                    if (invoiceFlag == this.invoiceFlagList[i].value) {
                        name = this.invoiceFlagList[i].text;
                        break;
                    }
                }
                return name;
            },
            enableNavigateBack: function () {
                var that = this;
                var isEnable = true;
                if (that.report.main.title.indexOf("区域经理") != -1) {
                    if (that.userInfo.roleName == '区域总监'
                        || that.userInfo.roleName == '区域支持'
                        || that.userInfo.roleName == '销售管理'
                    ) {
                        that.userType = '0'
                    }
                }
                console.log(that.userType, that.isComment)
                if (that.userType == '0') {
                    //必须评价
                    if (that.isComment == '0' && that.report.main.title.indexOf("区域经理") != -1) {
                        isEnable = false;
                    }
                }
                var param = {
                    enableNavigateBack: isEnable,
                }
                prompt(JSON.stringify(param))
            },
            showToast: function (title) {
                var param = {
                    title: title
                }
                JSBridge.call(UI, 'showToast', param)
            },
            getreceiver: function () {
                var that = this;
                $.ajax({
                    url: server.ip + '/wreport/getreceiver.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({
                        'userId': getUrlParamObj().userId,
                        'dataId': getUrlParamObj().id
                    }),
                    success: function (r) {
                        var res = r
                        that.userType = res.data.sendData.userType
                    },
                    error: function (e) {
                        this.appPopout(e.responseText)
                    }
                }, true);
            },
            getUserInfo: function () {
                var that = this;
                $.ajax({
                    url: server.ip + '/user/getUserViewById.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({
                        'id': getUrlParamObj().userId,
                    }),
                    success: function (r) {
                        console.log(r)
                        var res = r
                        that.userInfo = res.data.sendData
                    },
                    error: function (e) {
                        alert(e.responseText)
                    }
                }, false);
            },
            changeEvaluation: function (evaluation) {
                var that = this;
                if (that.pingjia.evaluation == evaluation) {
                    that.pingjia.pingjiaList = [];
                    that.pingjia.pingjia = [];
                    that.pingjia.pingjiaStrings = "";
                    that.pingjia.evaluation = ""
                } else {
                    that.pingjia.evaluation = evaluation
                    that.pingjia.pingjiaList = [];
                    that.pingjia.pingjiaStrings = "";
                    if (that.pingjia.evaluation == "合格") {
                        //查询合格的enum
                        that.getGrade("pingjia")
                    }
                    if (that.pingjia.evaluation == "不合格") {
                        that.getGrade("pingjia1")
                    }
                }

            },
            getGrade: function (type) {
                var that = this;
                $.ajax({
                    url: server.ip + '/enum2/selectByModuleType.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({moduleType: type}),
                    success: function (r) {
                        var res = r
                        for (var i = 0; i < res.data.sendData.length; i++) {
                            res.data.sendData[i].select = "0"
                        }
                        that.pingjia.pingjia = res.data.sendData
                        for (var i = 0; i < that.pingjia.pingjia.length; i++) {
                            if (that.pingjia.pingjiaStrings.indexOf(that.pingjia.pingjia[i].value) != -1) {
                                that.pingjia.pingjia[i].select = "1";
                            } else {
                                that.pingjia.pingjia[i].select = "0"
                            }
                        }
                    },
                    error: function (e) {
                        alert(e.responseText)
                    }
                }, true);
            },
            changeBuyDate: function (buyDate) {
                var a = '';
                switch (buyDate) {
                    case 'todayMonth':
                        a = '本月内'
                        break
                    case 'nextMonth':
                        a = '下月内'
                        break
                    case 'threeMonth':
                        a = '三月内'
                        break
                    case 'halfYear':
                        a = '半年内'
                        break
                }
                return a;
            },
            comment: function () {
                var that = this;
                var data = {};
                data.dataId = that.report.main.id;
                data.createUserId = getUrlParamObj().userId;
                data.createUserName = getUrlParamObj().userName;
                data.evaluation = that.pingjia.pingjiaStrings;
                data.otherDescription = that.pingjia.otherDescription;
                data.grade = that.pingjia.evaluation;
                data.wreportUserId = that.report.main.userId;
                data.reportDate = that.report.main.reportDate;
                if (!data.grade) {
                    this.appPopout("请评价报告是否合格")
                    return;
                }
                if (!data.otherDescription) {
                    this.appPopout("请填写评论描述")
                    return;
                }
                var obj = {
                    dialog: 'show'
                }
                prompt(JSON.stringify(obj))
                $.ajax({
                    url: server.ip + '/wreport/savePingjia.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify(data),
                    success: function (r) {
                        var res = r
                        var data = res.data.sendData;
                        var obj = {
                            dialog: 'hidden'
                        }
                        prompt(JSON.stringify(obj))
                        window.location.reload();
                    },
                    error: function (e) {
                        this.appPopout(e.responseText)
                    }
                });
            },
            checkedPingjia: function (item, value) {
                console.log(item)
                if (item.select == "0") {
                    item.select = "1"
                } else {
                    item.select = "0"
                }
                var idIndex = this.pingjia.pingjiaList.indexOf(value)
                if (idIndex >= 0) {
                    this.pingjia.pingjiaList.splice(idIndex, 1)
                } else {
                    this.pingjia.pingjiaList.push(value)
                }
                var pingjiaString = "";
                if (this.pingjia.pingjiaList.length > 0) {
                    for (var i = 0; i < this.pingjia.pingjiaList.length; i++) {
                        if (this.pingjia.pingjiaList[i] != "") {
                            pingjiaString += this.pingjia.pingjiaList[i] + "|";
                        }
                    }
                    this.pingjia.pingjiaStrings = pingjiaString.substring(0, pingjiaString.length - 1);
                } else {
                    this.pingjia.pingjiaStrings = ""
                }
                console.log(this.pingjia.pingjiaStrings)

            },
            appPopout:function (content) {
                var content = content;
                var param = {
                    title:content
                }
                JSBridge.call(UI, 'showToast', param)
            },
            OpenModle: function () {
                var num = 0;

                if (this.userInfo.roleName == "大区经理" || this.userInfo.roleName == "区域总监") {
                    for (var i = 0; i < this.report.tomorrowVisitPlan.length; i++) {
                        if (this.report.tomorrowVisitPlan[i].customerName != "" || this.report.tomorrowVisitPlan[i].customerAddress != "" || this.report.tomorrowVisitPlan[i].visitGoal) {
                            if (this.report.tomorrowVisitPlan[i].customerName == "") {
                                this.appPopout("请填写客户名称！");
                                return false;
                            }
                            if (!this.report.tomorrowVisitPlan[i].visitGoal && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                this.appPopout("请选择拜访目的！");
                                return false;
                            }
                            if ((this.userInfo.roleName == "大区经理" || this.userInfo.roleName == "区域总监") && getUrlParamObj().userId != '20180319111240919FEBB3615DA13C37') {
                                if (!this.report.tomorrowVisitPlan[i].entourage && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                    this.appPopout("请选择陪同人员！");
                                    return false;
                                }
                            }
                            if (this.report.tomorrowVisitPlan[i].customerAddress == "" && this.report.tomorrowVisitPlan[i].customerName != "请假") {
                                this.appPopout("请填写客户地点！");
                                return false;
                            }


                            num++;
                        }
                    }
                }

                if (this.isHasModule('todayVisitCustomerDebt')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if ((this.report.todayVisitCustomer[i].otherVisitType && this.report.todayVisitCustomer[i].otherVisitType != '')
                            || (this.report.todayVisitCustomer[i].debtCondition && this.report.todayVisitCustomer[i].debtCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel) {
                                this.appPopout("请填写客户电话！");
                                return false;
                            }
                        }
                    }
                }
                if (this.isHasModule('todayVisitCustomerLetters')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if ((this.report.todayVisitCustomer[i].otherVisitType && this.report.todayVisitCustomer[i].otherVisitType != '')
                            || (this.report.todayVisitCustomer[i].lettersCondition && this.report.todayVisitCustomer[i].lettersCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel) {
                                this.appPopout("请填写客户电话！");
                                return false;
                            }
                        }
                    }
                }

                if (this.userInfo.roleName == "区域经理"&&this.isHasModule('tomorrowAMPlan')&&this.isHasModule('tomorrowPMPlan')) {
                    console.log(this.report.tomorrowAMPlan.content)
                    if ((this.report.tomorrowAMPlan.content && this.report.tomorrowAMPlan.content.trim() == '') ||  (this.report.tomorrowPMPlan.content && this.report.tomorrowPMPlan.content.trim() == '')) {
                            this.appPopout("请填写第二天面访计划！")
                            return false;
                    }
                    if(!this.report.tomorrowAMPlan.content || !this.report.tomorrowPMPlan.content){
                        this.appPopout("请填写第二天面访计划！")
                        return false;
                    }
                }


                if (this.isHasModule('todayVisitCustomer')) {
                    var visitNum = 0;
                    var arrDistinctCustomerTels = [];
                    var arrSameCustomerTels = [];
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if (this.report.todayVisitCustomer[i].tel) {
                            if ($.inArray(this.report.todayVisitCustomer[i].tel, arrDistinctCustomerTels) == -1) {
                                arrDistinctCustomerTels.push(this.report.todayVisitCustomer[i].tel);
                            } else {
                                arrSameCustomerTels.push(this.report.todayVisitCustomer[i].tel);
                            }
                        }
                    }
                    if (arrSameCustomerTels.length > 0) {
                        this.appPopout("面访/电访存在相同的客户电话:" + arrSameCustomerTels.join(",") + "，请删除");
                        return false;
                    }
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        if (this.report.todayVisitCustomer[i].tel) {
                            if (!this.report.todayVisitCustomer[i].customerType) {
                                this.appPopout("请填写客户类型！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].otherCondition.trim()) {
                                this.appPopout("请填写资金情况、竞争对手情况等！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].source) {
                                this.appPopout("请填写客户来源！");
                                return false;
                            }
                            if (!this.report.todayVisitCustomer[i].name.trim()) {
                                this.appPopout("请填写客户姓名！");
                                return false;
                            }
                        }
                        if ((this.report.todayVisitCustomer[i].customerType && this.report.todayVisitCustomer[i].customerType != '')
                            || (this.report.todayVisitCustomer[i].otherCondition && this.report.todayVisitCustomer[i].otherCondition != '')
                            || (this.report.todayVisitCustomer[i].name && this.report.todayVisitCustomer[i].name != '')) {
                            if (!this.report.todayVisitCustomer[i].tel.trim()) {
                                this.appPopout("请填写客户电话！");
                                return false;
                            }
                        }
                        if (this.report.todayVisitCustomer[i].visitMode == '1') {
                            visitNum++;
                        }
                    }
                    console.log(visitNum)
                    if (this.report.visitLetterReason.content && this.report.visitLetterReason.content != '') {

                    } else {
                        if (this.userInfo.roleName == "区域经理" && visitNum < this.faceTarget) {
                            this.appPopout("请填写未到达拜访量原因")
                            return false;
                        }
                    }
                }
                if (this.isHasModule("regionDirectorTodayWork")) {
                    for (var i = 0; i < this.report.regionDirectorWorkList.length; i++) {
                        if (this.report.regionDirectorWorkList[i].reiongManagerId != "" && this.report.regionDirectorWorkList[i].content == "") {
                            this.appPopout("请填写今日下属工作情况描述");
                            return false;
                        }
                    }
                }

                if (this.isHasModule("subordinateTodayWork")) {
                    for (var i = 0; i < this.report.subordinateWorkList.length; i++) {
                        if (this.report.subordinateWorkList[i].reiongManagerId != "" && this.report.subordinateWorkList[i].content == "") {
                            this.appPopout("请填写今日下属工作情况描述");
                            return false;
                        }
                    }
                }

                if (this.userInfo.roleName == "区域经理" || this.userInfo.roleName == "大区经理" || this.userInfo.roleName == "大客户经理") {
                    var that = this;
                    that.showLoading()
                    $.wyui.postMethod(urlConfig.intentionCustomerManagement.getCountRegionCustomerByUserIdAndReportDate, {
                        "userId": getUrlParamObj().userId,
                        "reportDate": this.report.main.reportDate,
                    }, function (data) {
                        that.count = data.count;
                        if(parseInt(data.count)>0){
                            var param = {
                                title: '意向客户列表',
                                url:'/page/intentionManagement/quYuIntentionalListAppFromReport.html?userId=' + getUrlParamObj().userId + '&companyId='+that.userInfo.companyId,
                            }
                            JSBridge.call(ROUTER, 'navigateTo', param)
                            that.hideLoading()
                        } else {
                            $(".modleBj").show();
                            $(".saveModle").show();
                            that.hideLoading()
                        }
                    }, false);
                } else {
                    this.showLoading()
                    $(".modleBj").show();
                    $(".saveModle").show();
                    this.hideLoading()
                }

            },
            gotoDetail: function (item) {
                var data = {
                    id: item.id,
                    type: item.costSmallName,
                    clickType: "cost"
                }
                prompt(JSON.stringify(data))
            },
            saveGo: function () {
                var that = this;
                this.report.main.flage = "0";
                if (this.report.receivers.length === 0) {
                    this.appPopout("请填写收件人！");
                    return false;
                }
                for (var i = 0; i < this.report.todayCostDetail2.length; i++) {
                    if (this.report.todayCostDetail2[i].money != "" || this.report.todayCostDetail2[i].remark != "" || this.report.todayCostDetail2[i].costBigName != "" || this.report.todayCostDetail2[i].costSmallName != "") {
                        if (this.report.todayCostDetail2[i].costBigName == "" || this.report.todayCostDetail2[i].costSmallName == "") {
                            this.appPopout("请填写费用类型！");
                            return false;
                        }

                    }
                }

                if (this.isHasModule('todayVisitCustomerService')) {
                    for (var i = 0; i < this.report.todayVisitCustomer.length; i++) {
                        this.report.todayVisitCustomer[i].type = "1";
                        if (this.report.todayVisitCustomer[i].tel) {
                            if (!this.report.todayVisitCustomer[i].serverCondition) {
                                this.appPopout("请填写服务内容！");
                                return false;
                            }
                        }
                    }
                }
                that.showLoading();
                service.save(trimRN(this.removeNull()), function (r) {
                    if (!r.e.code) {
                        setTimeout(function () {
                            that.appPopout("发送成功!")
                        }, 2000);
                        var param = {
                            backRefresh: true,       //是否返回刷新
                        }
                        JSBridge.call(ROUTER, 'navigateBack', param)
                        that.hideLoading();
                    } else {
                        alert(r.e.desc)
                    }
                })

            },
            saveTraft: function () {
                var that = this;
                that.showLoading();
                this.report.main.flage = "-1";
                if (this.report.workOnTodayDescsZjlNew) {
                    for (var i = this.report.workOnTodayDescsZjlNew.saleList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.saleList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.saleList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.serverList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.serverList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.serverList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.financeList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.financeList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.financeList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.diconList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.diconList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.diconList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.bondList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.bondList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.bondList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.personList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.personList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.personList.splice(i, 1);
                        }
                    }
                }
                for (var i = this.report.todayGatherSituation.length - 1; i >= 0; i--) {
                    if (this.report.todayGatherSituation[i].money == "") {
                        this.report.todayGatherSituation.splice(i, 1);
                    }
                }
                if (this.report.workOnTodayDescsZjlNew) {
                    for (var i = this.report.workOnTodayDescsZjlNew.saleList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.saleList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.saleList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.serverList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.serverList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.serverList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.financeList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.financeList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.financeList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.diconList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.diconList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.diconList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.bondList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.bondList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.bondList.splice(i, 1);
                        }
                    }
                    for (var i = this.report.workOnTodayDescsZjlNew.personList.length - 1; i >= 0; i--) {
                        if (this.report.workOnTodayDescsZjlNew.personList[i].content == "") {
                            this.report.workOnTodayDescsZjlNew.personList.splice(i, 1);
                        }
                    }
                }
                console.log(trimRN(this.report));
                service.save(trimRN(this.report), function (r) {
                    if (!r.e.code) {
                        var param = {
                            backRefresh: false,       //是否返回刷新
                        }
                        that.appPopout("保存成功!")
                        setTimeout(JSBridge.call(ROUTER, 'navigateBack', param),5500)
                        that.hideLoading()
                    } else {
                        alert(r.e.desc);
                    }
                });
            },
            isHasModule: function (moduleEName) {
                var arrModuleENames = this.report.main.moduleENames.split(',');
                return $.inArray(moduleEName, arrModuleENames) > -1;
            },
            spliceString: function (evaluation, otherDescription) {
                if (evaluation.indexOf("|") != -1) {
                    return evaluation.replace(/\|/gi, ";") + ";" + otherDescription
                } else {
                    if (evaluation && evaluation != "") {
                        return evaluation + ";" + otherDescription
                    } else {
                        return otherDescription
                    }
                }
            },
            //人员轨迹
            track: function () {
                var that = this;
                var obj = {
                    type: 'baiduTrack',
                    name: that.trackParams.userName,
                    id: that.trackParams.userId,
                    date: that.report.main.reportDate
                }
                prompt(JSON.stringify(obj));
            },

        },

        mounted: function () {
            //判断有没有传过来的id
            //判断页面状态
            var that = this;
            that.showLoading();
//            var obj = {
//                dialog: 'show'
//            }
//            prompt(JSON.stringify(obj))
            that.getUserInfo();
            $.ajax({
                url: server.ip + '/intentCustomer/getForProvinceById.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({
                    'id': '0',
                }),
                success: function (r) {
                    var res = r
                    that.provinceList = res.data.sendData.records
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            $.ajax({
                url: server.ip + '/wreport/getCustomerType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({}),
                success: function (r) {
                    var res = r
                    that.customerType = res.data.sendData
                },
                error: function (e) {
                    alert(e.responseText)
                }

            });
            $.ajax({
                url: server.ip + '/user/getEntourage.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({userId: getUrlParamObj().userId}),
                success: function (r) {
                    var res = r
                    that.entourage = res.data.sendData;
                    if (!that.entourage) {
                        that.entourage = []
                    }
                    that.entourage.push({"name": "无"});
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            $.ajax({
                url: server.ip + '/enum2/selectByModuleType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({moduleType: 'feeType'}),
                success: function (r) {
                    var res = r
                    that.feeType = res.data.sendData
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            $.ajax({
                url: server.ip + '/wreport/getTarget.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({userId: getUrlParamObj().userId}),
                success: function (r) {
                    var res = r
                    that.faceTarget = res.data.sendData.result
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            $.ajax({
                url: server.ip + '/enum2/selectByModuleType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({moduleType: 'serviceType'}),
                success: function (r) {
                    var res = r
                    that.serverVisitType = res.data.sendData;
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            if (that.pingjia.evaluation == "合格") {
                //查询合格的enum
                that.getGrade("pingjia")
            }
            if (that.pingjia.evaluation == "不合格") {
                that.getGrade("pingjia1")
            }
            $.ajax({
                url: server.ip + '/enum2/selectByModuleType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({moduleType: 'serverCustomerType'}),
                success: function (r) {
                    var res = r
                    that.serverCustomerType = res.data.sendData;
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            $.ajax({
                url: server.ip + "/wreport/getExpenseByParentId.json",
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({parentId: 0, userId: getUrlParamObj().userId}),
                success: function (r) {
                    var res = r;
                    console.log(res.data.sendData)
                    that.costBigNameList = res.data.sendData;
                },
                error: function () {
                    alert("获取费用名称出错")
                }
            })
            $.ajax({
                url: server.ip + '/enum2/selectByModuleType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({moduleType: 'lettersType'}),
                success: function (r) {
                    var res = r
                    that.lettersVisitType = res.data.sendData;
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });

            $.ajax({
                url: server.ip + '/enum2/selectByModuleType.json',
                contentType: 'application/json;charset=utf-8',
                type: "POST",
                data: JSON.stringify({moduleType: 'debtType'}),
                success: function (r) {
                    var res = r
                    that.debtVisitType = res.data.sendData;
                },
                error: function (e) {
                    alert(e.responseText)
                }
            });
            if (getUrlParamObj().id) {
                that.showLoading();
                that.pageType = getUrlParamObj().pageType;
                var data = {
                    id: getUrlParamObj().id,
                }
                //获得是否是第一次打开阅读工作报告数据
                var dataCount = {
                    wid: getUrlParamObj().id,
                    userId: getUrlParamObj().userId
                }
                //插入记录第一次打开和关闭工作报告添加的数据
                var timedata = {
                    dataId: getUrlParamObj().id,
                    createUserId: getUrlParamObj().userId
                }
                $.ajax({
                    url: server.ip + urlConfig.wreport.wreport.getById,
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify(data),
                    success: function (r) {
                        that.pingjiaFlag = 'true'
                        var obj = {
                            dialog: 'hidden'
                        }
                        prompt(JSON.stringify(obj))
                        var res = r
                        for (var i = 0; i < res.data.sendData.todayVisitCustomer.length; i++) {
                            if (res.data.sendData.todayVisitCustomer[i].serverCustomerType) {
                                res.data.sendData.todayVisitCustomer[i].checkedServerCustomerLists = res.data.sendData.todayVisitCustomer[i].serverCustomerType.split(",");
                            } else {
                                res.data.sendData.todayVisitCustomer[i].checkedServerCustomerLists = [];
                            }
                        }
                        that.report.subordinateWorkList = res.data.sendData.subordinateWorkList;
                        that.report.regionDirectorWorkList = res.data.sendData.regionDirectorWorkList;
                        console.log(reportCountFixed(res.data.sendData))
                        that.report = reportCountFixed(res.data.sendData);
                        //评价列表
                        $.ajax({
                            url: server.ip + '/wreport/getPingjiaList.json',
                            contentType: 'application/json;charset=utf-8',
                            type: "POST",
                            data: JSON.stringify({
                                'reportDate': that.report.main.reportDate,
                                'sendUserId': that.report.main.userId,
                            }),
                            success: function (r) {
                                var res = r
                                var data = res.data.sendData;
                                that.commentList = data.yesTodayList
                                that.commentTitle = "评价列表"
                                if (data.yesToday) {
                                    that.commentTishi = data.yesToday
                                }
                                that.hideLoading()
                            },
                            error: function (e) {
                                alert(e.responseText)
                            }
                        });
                        //获取评价
                        $.ajax({
                            url: server.ip + '/wreport/getPingjia.json',
                            contentType: 'application/json;charset=utf-8',
                            type: "POST",
                            data: JSON.stringify({
                                'createUserId': getUrlParamObj().userId,
                                'dataId': getUrlParamObj().id
                            }),
                            success: function (r) {
                                var res = r
                                var data = res.data.sendData.pingjia;
                                if (res.data.sendData.pingjia && res.data.sendData.pingjia.grade != "") {
                                    that.isComment = "1"
                                }
                                if (data) {
                                    if (data.evaluation != "") {
                                        that.pingjia.pingjiaList = data.evaluation.split("|");
                                    } else {
                                        that.pingjia.pingjiaList = []
                                    }
                                    that.pingjia.pingjiaStrings = data.evaluation
                                    that.pingjia.otherDescription = data.otherDescription
                                    that.pingjia.evaluation = data.grade
                                    if (data.grade == '合格') {
                                        that.getGrade("pingjia")
                                    }
                                    if (that.pingjia.evaluation == "不合格") {
                                        that.getGrade("pingjia1")
                                    }

                                }
                                that.enableNavigateBack();
                            },
                            error: function (e) {
                                alert(e.responseText)
                            }
                        });
                        that.getreceiver();
                        $.ajax({
                            url: server.ip + urlConfig.system.user.getUserViewById,
                            contentType: 'application/json;charset=utf-8',
                            type: "POST",
                            data: JSON.stringify({id: that.report.main.userId}),
                            success: function (r) {
                                var res = r
                                that.trackParams.userId = res.data.sendData.id;
                                that.trackParams.userName = res.data.sendData.name;
                                console.log(that.trackParams.userId)
                                console.log(that.trackParams.userName)
                            },
                            error: function (e) {
                                alert(e.responseText)
                            }
                        });

                    },
                    error: function (e) {
                        alert(e.responseText)
                    }
                });
                //获得收件人和抄送人第一次阅读工作报告打开和关闭时间
                if (getUrlParamObj().isLook) {
                    $.ajax({
                        url: server.ip + '/module/getWhetherFirstReading.json',
                        contentType: 'application/json;charset=utf-8',
                        type: "POST",
                        data: JSON.stringify(dataCount),
                        success: function (r) {
                            var res = r
                            if (!res.data.sendData) {
                                $.ajax({
                                    url: server.ip + '/module/saveReordTime.json',
                                    contentType: 'application/json;charset=utf-8',
                                    type: "POST",
                                    data: JSON.stringify(timedata),
                                    success: function (r) {
                                    },
                                    error: function (e) {
                                        alert(e.responseText)
                                    }
                                })
                            }
                        },
                        error: function (e) {
                            alert(e.responseText)
                        }
                    });
                }
            }else{
                that.showLoading();
                var date = (new Date()).Format("yyyy-MM-dd");
                var dateYesterday = new Date();
                dateYesterday.addDays(-1);
                $.wyui.postMethod("/wreport/getByUserIdAndReportDate.json",{
                    userId: getUrlParamObj().userId,
                    reportDate: getUrlParamObj().reportDate
                }, function (data) {
                    that.pageType = "edit";
                    that.pingjiaFlag = 'true';
                    that.report.todayCostDetail = data.todayCostDetail;
                    if (data.main != null) {
                        that.report.workOnTodayDescsZjlNew = data.workOnTodayDescsZjlNew;
                        var subordinateWorkList = data.subordinateWorkList;
                        if (subordinateWorkList) {
                            for (var i = 0; i < subordinateWorkList.length; i++) {
                                if (subordinateWorkList[i].reiongManagerId && !subordinateWorkList[i].haveAccompany) {
                                    subordinateWorkList[i].haveAccompany = '否';
                                }
                            }
                        }
                        that.report.subordinateWorkList = subordinateWorkList;
                        that.report.regionDirectorWorkList = data.regionDirectorWorkList;
                        $.wyui.postMethod("/wreport/getReceiverAndCopiers.json", {
                            userId: getUrlParamObj().userId,
                        }, function (emailReceiver) {
                            data.receivers = emailReceiver.receivers;
                            data.copiers = emailReceiver.copiers;
                            var receiversids = "";
                            for (i = 0; i < emailReceiver.receivers.length; i++) {
                                receiversids = receiversids + emailReceiver.receivers[i].userId + "|";

                            }
                            that.receiversUserIds = receiversids.slice(0, receiversids.length - 1);
                            for (i = 0; i < emailReceiver.copiers.length; i++) {
                                receiversids = receiversids + emailReceiver.copiers[i].userId + "|";

                            }
                            that.deleteList = receiversids.slice(0, receiversids.length - 1);
                            data.handAddReceivers = emailReceiver.handAddReceivers;
                            data.handAddCopiers = emailReceiver.handAddCopiers;
                            for (i = 0; i < emailReceiver.handAddReceivers.length; i++) {
                                if (that.deleteList.indexOf(emailReceiver.handAddReceivers[i].userId) == -1) {
                                    data.receivers.push(emailReceiver.handAddReceivers[i]);
                                }
                            }
                            for (i = 0; i < emailReceiver.handAddCopiers.length; i++) {
                                if (that.deleteList.indexOf(emailReceiver.handAddCopiers[i].userId) == -1) {
                                    data.copiers.push(emailReceiver.handAddCopiers[i]);
                                }
                            }
                            console.log(data.todayVisitCustomer)
                            for (var i = 0; i < data.todayVisitCustomer.length; i++) {
                                if (data.todayVisitCustomer[i].serverCustomerType) {
                                    data.todayVisitCustomer[i].checkedServerCustomerLists = data.todayVisitCustomer[i].serverCustomerType.split(",");
                                } else {
                                    data.todayVisitCustomer[i].checkedServerCustomerLists = [];
                                }
                            }
                            that.report = reportCountFixed(data);
                            console.log(that.report)
                            var preDate = that.getNextDate(that.report.main.reportDate, -1)
                            $.wyui.postMethod('/wreport/getPingjiaList.json', {
                                'reportDate': preDate,
                                'sendUserId': that.report.main.userId,
                            }, function (r) {
                                console.log(r);
                                //查看是当前的报告评价
                                if (r.yesTodayList) {
                                    that.commentList = r.yesTodayList
                                } else {
                                    that.commentList = []
                                }
                                that.commentTitle = "上次评价描述"
                                if (r.yesToday) {
                                    that.commentTishi = r.yesToday
                                }
                                if (that.pingjiaNum < 0) {
                                    that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                                }
                                that.hideLoading()
                            })
                        }, false, false);
                        data.weekPlan = [];
                        $.wyui.postMethod('/weekPlan/getWeek.json', {
                            reportDate: getUrlParamObj().reportDate,
                            createUserId: getUrlParamObj().userId
                        }, function (r) {
                            data.weekPlan = that.tablesMergeCell(r.records);
                        }, false, false);

                    } else {
                        that.showLoading()
                        that.report.main.userId = getUrlParamObj().userId;
                        var subordinateWorkList = data.subordinateWorkList;
                        if (subordinateWorkList) {
                            for (var i = 0; i < subordinateWorkList.length; i++) {
                                if (subordinateWorkList[i].reiongManagerId && !subordinateWorkList[i].haveAccompany) {
                                    subordinateWorkList[i].haveAccompany = '否';
                                }
                            }
                        }
                        that.report.subordinateWorkList = subordinateWorkList;
                        that.report.regionDirectorWorkList = data.regionDirectorWorkList;
                        that.report.todayCustomerVisit = data.todayCustomerVisit;
                        that.report.todayCustomerTelVisit = data.todayCustomerTelVisit;
                        that.report.todayVisitCustomer = data.todayVisitCustomer;
                        console.log(that.report.todayVisitCustomer)
                        for (var i = 0; i < data.todayVisitCustomer.length; i++) {
                            if (data.todayVisitCustomer[i].serverCustomerType) {
                                that.report.todayVisitCustomer[i].checkedServerCustomerLists = data.todayVisitCustomer[i].serverCustomerType.split(",");
                            } else {
                                that.report.todayVisitCustomer[i].checkedServerCustomerLists = [];

                            }
                        }
//                        that.report.todayVisitCustomerBigRegion = data.todayVisitCustomerBigRegion;
                        if (data.unfinishes) {
                            that.report.unfinishes = data.unfinishes;
                        }
                        if (that.userInfo.roleName == "大区经理") {
                            if (that.dateReissueEnd == 'true') {
                                that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + '-大区)' + '【补】';
                            } else {
                                that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + '-大区)';
                            }
                        } else if (that.userInfo.roleName == "区域经理" || that.userInfo.roleName == "大客户经理") {
                            $.wyui.postMethod("/region/getRegionByWreport.json", {
                                userId: getUrlParamObj().userId,
                                roleName:that.userInfo.roleName
                            }, function (r) {
                                if (r.roleNames) {

                                    if (that.dateReissueEnd == 'true') {
                                        that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + '-' + r.roleNames + ')' + '【补】';
                                    } else {
                                        that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + '-' + r.roleNames + ')';
                                    }
                                } else {
                                    if (that.dateReissueEnd == 'true') {
                                        that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + ')' + '【补】';
                                    } else {
                                        that.report.main.title = getUrlParamObj().reportDate + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + ')';
                                    }
                                }
                            });
                        } else {
                            if (that.dateReissueEnd == 'true') {
                                that.report.main.title = getUrlParamObj().reportDate + " " + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + ')' + '【补】';
                            } else {
                                that.report.main.title = getUrlParamObj().reportDate + " " + that.userInfo.roleName + '工作报告' + '(' + that.userInfo.name + ')';
                            }
                        }

                        that.report.main.reportDate = getUrlParamObj().reportDate;
                        service.getModuleENamesByUserId({userId: getUrlParamObj().userId}, function (data) {
                            var eNames = [];
                            for (var i = 0; i < data.length; i++) {
                                eNames.push(data[i].eName);
                            }
                            that.report.main.moduleENames = eNames.join(',');
                            console.log(that.report)
                            that.report = reportCountFixed(that.report);

                            var preDate = that.getNextDate(that.report.main.reportDate, -1)
                            $.wyui.postMethod('/wreport/getPingjiaList.json', {
                                'reportDate': preDate,
                                'sendUserId': that.report.main.userId
                            }, function (r) {
                                console.log(r);
                                //查看是当前的报告评价
                                if (r.yesTodayList) {
                                    that.commentList = r.yesTodayList
                                } else {
                                    that.commentList = []
                                }
                                that.commentTitle = "上次评价描述"
                                if (r.yesToday) {
                                    that.commentTishi = r.yesToday
                                }
                                if (that.pingjiaNum < 0) {
                                    that.leftNum = that.leftNum + Math.abs(that.pingjiaNum)
                                }

                            }, false)

                        });
                        $.wyui.postMethod(urlConfig.wreport.wreport.getReceiverAndCopiers, {
                            userId: getUrlParamObj().userId,
                        }, function (emailReceiver) {
                            console.log(emailReceiver.receivers)
                            that.report.receivers = emailReceiver.receivers;
                            that.report.copiers = emailReceiver.copiers;
                            var receiversids = "";
                            for (i = 0; i < emailReceiver.receivers.length; i++) {
                                receiversids = receiversids + emailReceiver.receivers[i].userId + "|";
                            }
                            that.receiversUserIds = receiversids.slice(0, receiversids.length - 1);
                            for (i = 0; i < emailReceiver.copiers.length; i++) {
                                receiversids = receiversids + emailReceiver.copiers[i].userId + "|";
                            }
                            that.deleteList = receiversids.slice(0, receiversids.length - 1);
                            that.report.handAddReceivers = emailReceiver.handAddReceivers;
                            that.report.handAddCopiers = emailReceiver.handAddCopiers;
                            for (i = 0; i < emailReceiver.handAddReceivers.length; i++) {
                                if (that.deleteList.indexOf(that.report.handAddReceivers[i].userId) == -1) {
                                    that.report.receivers.push(emailReceiver.handAddReceivers[i]);
                                }
                            }
                            for (i = 0; i < emailReceiver.handAddCopiers.length; i++) {
                                if (that.deleteList.indexOf(that.report.handAddCopiers[i].userId) == -1) {
                                    that.report.copiers.push(emailReceiver.handAddCopiers[i]);
                                }
                            }
                            that.hideLoading()
                        }, false, false);
                        if (that.userInfo.roleName == "区域经理" || that.userInfo.roleName == "大区经理" || that.userInfo.roleName == "区域总监") {
                            that.initData();
                        }
                    }
                    that.endLoad = 'true';
                });
            }
        }
    });

    function renderLines(el, lineIndex) {

        $(".txtParent").eq(lineIndex).autoComplete({
            url: server.ip + "/weekPlan/getNameAndTel.json",
            render: function (r, panel) {
                for (var i = 0; i < r.length; i++) {
                    $("<li></li>").data("autoComplete",
                        r[i]).html("<a>" + r[i].customerName + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + r[i].customerTel + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.report.tomorrowVisitPlan[app.currentfocus].customerName = r.customerName;
                app.report.tomorrowVisitPlan[app.currentfocus].customerAddress = r.customerAddress;
                app.report.tomorrowVisitPlan[app.currentfocus].lastVisitTime = r.lastVisitTime;
                app.report.tomorrowVisitPlan[app.currentfocus].customerIndustry = r.customerIndustry;
                app.report.tomorrowVisitPlan[app.currentfocus].intentionDevice = r.intentionDevice;
                return false;
            },
            extraParams: {createUserId: getCurrentUser().id},
            height: 210,
            width: 300
        });
    }
    Vue.directive('line-inserted', {
        inserted: function (el, binding) {
            console.log(el);
            var lineIndex = binding.value;
            renderLines(el, lineIndex);
        }
    });
    $(function () {
        $(".saveModle").show();
        $("#txtReceiver,#txtCopier").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                var receiverIds = new Array();
                for (var i = 0; i < app.report.receivers.length; i++) {
                    receiverIds.push(app.report.receivers[i].userId);
                }
                for (var i = 0; i < app.report.copiers.length; i++) {
                    receiverIds.push(app.report.copiers[i].userId);
                }

                if ($.inArray(user.id, receiverIds) > -1) {
                    this.appPopout("收件人或抄送人重复");
                    $(this).val("");
                    return false;
                } else {
                    if (this.id == "txtReceiver") {
                        app.report.receivers.push({userId: user.id, userName: user.name});
                        app.report.handAddReceivers.push({userId: user.id, userName: user.name});
                    } else {
                        app.report.copiers.push({userId: user.id, userName: user.name});
                        app.report.handAddCopiers.push({userId: user.id, userName: user.name});

                    }
                    $(this).val("");
                    return false;
                }
            },
            height: 210,
            width: 320,
            top: 0,
            left: 0
        });
        $(".saveModle").hide();
    });

    //修正工作报告各个模块的默认行数
    function reportCountFixed(report) {

        for (var i = report.tomorrowVisitPlan.length; i < 1; i++) {
            report.tomorrowVisitPlan.push(new Template.TomorrowVisitPlan());
        }
        for (var i = report.troubleShooting.length; i < 3; i++) {
            report.troubleShooting.push(new Template.Unfinish('1'));
        }

        for (var i = report.forSupportMatters.length; i < 2; i++) {
            report.forSupportMatters.push(new Template.Unfinish('2'));
        }
        for (var i = report.todayCustomerVisit.length; i < 1; i++) {
            report.todayCustomerVisit.push(new Template.CustomerSaler());
        }
        for (var i = report.todayCustomerTelVisit.length; i < 1; i++) {
            report.todayCustomerTelVisit.push(new Template.CustomerSalerTel());
        }
        for (var i = report.workOnTodayDescs.length; i < 1; i++) {
            report.workOnTodayDescs.push(new Template.WorkOnTodayDesc());
        }
        // for (var i = report.workOnTodayDescsZjl.length; i < 1; i++) {
        //     report.workOnTodayDescsZjl.push(new Template.WorkOnTodayDescsZjl());
        // }

        for (var i = report.workOnTodayDescsZjlNew.saleList.length; i < 3; i++) {
            report.workOnTodayDescsZjlNew.saleList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.serverList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.serverList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.financeList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.financeList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.diconList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.diconList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.bondList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.bondList.push(new Template.WorkOnTodayDescsZjl());
        }
        for (var i = report.workOnTodayDescsZjlNew.personList.length; i < 1; i++) {
            report.workOnTodayDescsZjlNew.personList.push(new Template.WorkOnTodayDescsZjl());
        }

        for (var i = report.unfinishes.length; i < 1; i++) {
            report.unfinishes.push(new Template.Unfinish('3'));
        }
        for (var i = report.todayCostDetail2.length; i < 1; i++) {
            report.todayCostDetail2.push(new Template.Cost());
        }
        for (var i = report.jobDescriptionForBranch.length; i < 5; i++) {
            report.jobDescriptionForBranch.push(new Template.Branch());
        }
        for (var i = report.todayGatherSituation.length; i < 1; i++) {
            report.todayGatherSituation.push(new Template.Gather());
        }
        if (report.todayVisitCustomer == null || report.todayVisitCustomer.length == 0) {
            for (var i = report.todayVisitCustomer.length; i < 1; i++) {
                report.todayVisitCustomer.push(new Template.CustomerSalerVisit());
            }
        }
        // if (report.todayVisitCustomerBigRegion == null || report.todayVisitCustomerBigRegion.length == 0) {
        //     for (var i = report.todayVisitCustomerBigRegion.length; i <1; i++) {
        //         report.todayVisitCustomerBigRegion.push(new Template.CustomerSalerVisitRegion());
        //     }
        // }
        return report;
    }
</script>
<script>
    //禁用返回键后,点击app返回键回调
    function onBackPressed(enableNavigateBack) {
        if (enableNavigateBack) {
            //获得是否是第一次打开阅读工作报告数据
            var dataCount = {
                wid: getUrlParamObj().id,
                userId: getUrlParamObj().userId
            }
            if (getUrlParamObj().isLook) {
                $.ajax({
                    url: server.ip + '/module/getWhetherFirstReading.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify(dataCount),
                    success: function (r) {
                        var res = r
                        if (res.data.sendData && res.data.sendData.id && !res.data.sendData.closeTime) {
                            var wrtTimeEntity = {
                                id: res.data.sendData.id,
                                dataId: res.data.sendData.dataId,
                                createUserId: res.data.sendData.createUserId,
                            }
                            $.ajax({
                                url: server.ip + '/module/saveReordTime.json',
                                contentType: 'application/json;charset=utf-8',
                                type: "POST",
                                data: JSON.stringify(wrtTimeEntity),
                                success: function (r) {
                                },
                                error: function (e) {
                                    alert(e.responseText)
                                }
                            })
                        }
                    },
                    error: function (e) {
                        alert(e.responseText)
                    }
                });
            }
        } else {
            var param = {
                title: "请评价该工作报告"
            }
            JSBridge.call(UI, 'showToast', param)
        }
    }
</script>
<script type="text/javascript">
    $(function () {
        $("body").on("click", ".td-value ", function (e) {
            console.log(app.pageType)
            if (app.pageType == "edit") {
                return true;
            } else {
                if ($(".div-td-content-more").is(":hidden")) {
                    var text = $(this).html();
                    if (text != "") {
                        text = "<i></i>" + text;
                        $(".div-td-content-more").html(text).css({
                            "width": $(this).outerWidth() + "px",
                            "left": $(this).offset().left,
                            "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                        }).show();
                        e.stopPropagation();
                    }
                } else {
                    $(".div-td-content-more").hide();
                }
            }
        });

        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", ".visitGoalShow", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
            $("#entourage").hide();
        });
        $("body").on("click", ".selectModel", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": "275px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName = $(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content" + " ." + boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
//            if ($(this).hasClass("active")) {
//                return false;
//            }
            $(this).parent().find("a").removeClass("active");
            var id = $(this).attr("attr-id");
            $(this).addClass("active");
            var val = $(this).text();
            if ($(this).parents(".model-select").hasClass("type")) {
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                $(".xianValue").attr("data-shen", val);
                app.getCity(id);
                $(".model-select-content .brand").show();

            } else if ($(this).parents(".model-select").hasClass("brand")) {
                $(".model-select-tab a").removeClass("active");
                var id = $(this).attr("attr-id");
                $(".model-select-tab a[data-count=model]").addClass("active");
                $(".model-select").hide();
                $(".xianValue").attr("data-shi", val);
                app.getCounty(id);
                $(".model-select-content .model").show();

            } else {
                $(".xianValue").attr("data-xian", val);
                console.log(app.report.tomorrowVisitPlan);
                $(".xianValue").val($(".xianValue").attr("data-shen") + "-" + $(".xianValue").attr("data-shi") + "-" + $(".xianValue").attr("data-xian"));
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });

</script>
</body>
</html>